********************************************************************************
*PROJECT: Legislature Integration and Bipartisanship: A Natural Experiment in Iceland							   
*PURPOSE: Prep MP bio, to be used in Iceland_MP_prep	   
********************************************************************************

// preliminary
clear all
set maxvar 32767
set mem 1g
set more off
local seatingfolder = "$path_pch\Data\raw\Seating"
local cosponfolder = "$path_pch\Data\raw\Co-Sponsorship"
local MPfolder = "$path_pch\Data\raw\MP"
local MPintfolder = "$path_pch\Data\intermediate\MP"

********************************************************************************
// Bring seating data, get names that we need to identify the bio info.
********************************************************************************
// bring
forv i=115/120 {
	import delim using "`seatingfolder'\althingi journals\digitised\seating_journal_`i'.csv", clear encoding("utf-8")
	replace seat = seat+(seat>=14)+2*(seat>=30) // Reflect the naming convention difference (see email from Ingvi)
	tempfile ses`i'
	save `ses`i''
}
forv i=121/123 {
	import delim "`seatingfolder'\initialassign\seating_scraped_`i'.csv", clear encoding("utf-8")
	replace seat = seat+(seat>=14)+2*(seat>=30) // Reflect the naming convention difference (see email from Ingvi)
	tempfile ses`i'
	save `ses`i''
}
forv i=124/149 {
	import delim "`seatingfolder'\initialassign\seating_scraped_`i'.csv", clear encoding("utf-8")
	tempfile ses`i'
	save `ses`i''
}
use `ses115', clear
forv i=116/149 {
	append using `ses`i''
}

// drop empty seats and speaker seats (speaker will be added manually below)
drop if inlist(mp_name,"varamanns","forseta")

// change middle name format (put . after abbreviated middle name)
split mp_name
replace mp_name2 = mp_name2 + "." if mp_name2 == "Á"
replace mp_name2 = mp_name2 + "." if mp_name2 == "Kr"
replace mp_name2 = mp_name2 + "." if length(mp_name2) == 1
replace mp_name = mp_name1 + " " + mp_name2
replace mp_name = mp_name + " " + mp_name3 if !mi(mp_name3)
drop mp_name?

// Add speakers to the data
forv l = 1/35 {
	local ob = _N + 1
	local k = `l'+114
	local speaker: word `l' of "Salome Þorkelsdóttir" "Salome Þorkelsdóttir" "Salome Þorkelsdóttir" "Salome Þorkelsdóttir" "Ólafur G. Einarsson" "Ólafur G. Einarsson" "Ólafur G. Einarsson" "Ólafur G. Einarsson" "Ólafur G. Einarsson" "Halldór Blöndal" "Halldór Blöndal" "Halldór Blöndal" "Halldór Blöndal" "Halldór Blöndal" "Halldór Blöndal" "Halldór Blöndal" "Halldór Blöndal" "Sólveig Pétursdóttir" "Sólveig Pétursdóttir" "Sturla Böðvarsson" "Sturla Böðvarsson" "Sturla Böðvarsson" "Ásta R. Jóhannesdóttir" "Ásta R. Jóhannesdóttir" "Ásta R. Jóhannesdóttir" "Ásta R. Jóhannesdóttir" "Ásta R. Jóhannesdóttir" "Einar K. Guðfinnsson" "Einar K. Guðfinnsson" "Einar K. Guðfinnsson" "Einar K. Guðfinnsson" "Steingrímur J. Sigfússon" "Unnur Brá Konráðsdóttir" "Steingrímur J. Sigfússon" "Steingrímur J. Sigfússon"
	set obs `ob'
	replace mp_name = "`speaker'" in `ob'
	replace sessionnum = `k' in `ob'
	replace seat = 31 in `ob' // The speaker's seat! (except for one case)
}
replace seat = 30 if sessionnum == 129 & seat == 31 //exceptional case where the speaker sat at 30 instead of 31.
sort sessionnum seat
duplicates drop
isid sessionnum seat // should be no duplicate

// Will save the seat code here (instead of number)
ren seat seatno_init
g seat_init = ""

// match in our coding
local codes "S LF6 LF5 LF4 LF3 LF2 LF1 UF1 UF2 UF3 UF4 UF5 UF6 LC9 LC8 LC7 LC6"
local codes "`codes' LC5 LC4 LC3 LC2 LC1 UC1 UC2 UC3 UC4 UC5 UC6 UC7 UC8 UC9 LB13" 
local codes "`codes' LB12 LB11 LB10 LB9 LB8 LB7 LB6 LB5 LB4 LB3 LB2 LB1 UB1 UB2"
local codes "`codes' UB3 UB4 UB5 UB6 UB7 UB8 UB9 UB10 UB11 UB12 UB13"

forv i=1/57 {
	local c: word `i' of `codes'
	replace seat_init = "`c'" if seatno_init==`i'
}

drop if mi(seat_init) // drop ministers
keep mp_name sessionnum

// name changes to make merge perfect (with cosponsorship MP list)
replace mp_name = "Birkir Jón Jónsson" if mp_name=="Birkir J. Jónsson" 
replace mp_name = "Ólína Kjerúlf Þorvarðardóttir" if mp_name=="Ólína Þorvarðardóttir"
replace mp_name = "Bjarkey Olsen Gunnarsdóttir" if mp_name=="Bjarkey Gunnarsdóttir"
replace mp_name = "Ólína Kjerúlf Þorvarðardóttir" if mp_name=="Guðbjartur Hannesson" & sessionnum == 145 // Guðbjartur died before random draw happened.
replace mp_name = "Ísólfur Gylfi Pálmason" if mp_name == "?sólfur Gylfi Pálmason"
replace mp_name = "Árni M. Mathiesen" if mp_name == "Ami M. Mathiesen"
replace mp_name = "Jóhann Ársælsson" if mp_name == "Jóhann Arsælsson"
replace mp_name = "Logi Einarsson" if mp_name == "Logi Már Einarsson" & sessionnum == 146
replace mp_name = "Ólafur Ragnar Grímsson" if mp_name == "Olafur Ragnar Grímsson"
replace mp_name = "Ólafur Þ. Þórðarson" if mp_name == "Olafur Þ. Þórðarson"
replace mp_name = "Ragnar Arnalds" if mp_name == "Ragnar Amalds"
replace mp_name = "Árni Johnsen" if mp_name == "Ámi Johnsen"
replace mp_name = "Árni R. Árnason" if mp_name == "Árni R. Ámason"
replace mp_name = "Þórdís Kolbrún R. Gylfadóttir" if mp_name == "Þórdís Kolbrún R"


tempfile mp_seating
save `mp_seating'

********************************************************************************
// Get Rohil and Phoebe's gender guess
********************************************************************************

import excel using "`MPfolder'\PoliticianData.xlsx", clear sheet("Sheet1")
ren A MP_id
ren B MP_name
ren C party
ren D party_transl
ren E gender
ren F start_year
ren G end_year
ren H MP_notes
drop in 1
keep MP_id gender
duplicates drop
tempfile gender
save `gender'


********************************************************************************
// Bring cosponsorship data, get the best guess of the party for that session...
// using earliest abbreviation used, add to the names above.
********************************************************************************

import delimited using "`cosponfolder'\cosponsorship.csv", clear enc("utf-8") varn(1)

// dates
g day = substr(billdate,1,2)
g month=substr(billdate,4,2)
g year=substr(billdate,7,4)
destring day month year, replace

// keep mp per session
keep mp_id mp_name mp_party sessionnum day month year
sort sessionnum mp_id year month day
duplicates drop sessionnum mp_id, force

// match abbreviation with party name (party names manually acquired: see help/parties.do)
gen party_guess = ""
forv k = 1/20 {
	local ab: word `k' of A Ab F S SK U Þ JA Sf Óh Fl Vg Bhr Hr Bf V Flf M P None
	local full: word `k' of "Alþýðuflokkur" "Alþýðubandalagið" "Framsóknarflokkur" "Sjálfstæðisflokkur" "Samtök um kvennalista" "utan flokka" "Þjóðvaki - hreyfing fólksins" "þingflokkur jafnaðarmanna" "Samfylkingin" "Þingflokkur óháðra" "Frjálslyndi flokkurinn" "Vinstri hreyfingin – grænt framboð" "Borgarahreyfingin" "Hreyfingin" "Björt framtíð" "Viðreisn" "Flokkur fólksins" "Miðflokkurinn" "Píratar" "None"
	replace party_guess = "`full'" if mp_party == "`ab'"
	// "utan flokka" means an MP with no party affiliation because he or she quit the party but stayed in parliament
	// "None" means a non-MP minister without party affiliation
}
keep sessionnum mp_id mp_name party 
merge 1:1 sessionnum mp_name using `mp_seating', nogen
ren mp_id MP_id
merge n:1 MP_id using `gender', keep(1 3) nogen

********************************************************************************
// Manually collect bio information.
********************************************************************************

gen finished = 0
gen party = party_guess
sort mp_name sessionnum
order sessionnum MP_id mp_name gender party party_guess

tempfile main
save `main'

/*
// Create syntax below automatically (only need to do once to copy and paste)
gsort mp_name - gender
replace gender = gender[_n-1] if mi(gender) & !mi(gender[_n-1]) & mp_name == mp_name[_n-1]
gsort mp_name - MP_id
replace MP_id = MP_id[_n-1] if mi(MP_id) & !mi(MP_id[_n-1]) & mp_name == mp_name[_n-1]
gsort mp_name - party
replace party = party[_n-1] if mi(party) & !mi(party[_n-1]) & mp_name == mp_name[_n-1]

duplicates drop mp_name, force
file open syntaxfile using "`MPintfolder'\syntax.txt", r w
local N = _N
forv i = 1/`N' {
	preserve
		keep in `i'
		foreach var of varlist * {
			local `var' = `var'
		}
		file write syntaxfile `"replace MP_id = `MP_id' if mp_name == "`mp_name'""' _newline
		file write syntaxfile `"replace gender = "`gender'" if mp_name == "`mp_name'""' _newline
		file write syntaxfile `"replace party = "`party'" if mp_name == "`mp_name'""' _newline
		file write syntaxfile `"replace finished = 1 if mp_name == "`mp_name'""' _newline `"/*"' _newline
		// `"*/"'
	restore
}
file close syntaxfile
*/

replace MP_id = 1347 if mp_name == "Adda María Jóhannsdóttir"
replace gender = "F" if mp_name == "Adda María Jóhannsdóttir"
replace party = "Samfylkingin" if mp_name == "Adda María Jóhannsdóttir"
replace finished = 1 if mp_name == "Adda María Jóhannsdóttir"

replace MP_id = 646 if mp_name == "Adolf H. Berndsen"
replace gender = "M" if mp_name == "Adolf H. Berndsen"
replace party = "Sjálfstæðisflokkur" if mp_name == "Adolf H. Berndsen"
replace finished = 1 if mp_name == "Adolf H. Berndsen"

replace MP_id = 1324 if mp_name == "Albertína Friðbjörg Elíasdóttir"
replace gender = "F" if mp_name == "Albertína Friðbjörg Elíasdóttir"
replace party = "Samfylkingin" if mp_name == "Albertína Friðbjörg Elíasdóttir"
replace finished = 1 if mp_name == "Albertína Friðbjörg Elíasdóttir"

replace MP_id = 1021 if mp_name == "Alma Lísa Jóhannsdóttir"
replace gender = "F" if mp_name == "Alma Lísa Jóhannsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Alma Lísa Jóhannsdóttir"
replace finished = 1 if mp_name == "Alma Lísa Jóhannsdóttir"

replace MP_id = 1138 if mp_name == "Amal Tamimi"
replace gender = "F" if mp_name == "Amal Tamimi"
replace party = "Samfylkingin" if mp_name == "Amal Tamimi"
replace finished = 1 if mp_name == "Amal Tamimi"

replace MP_id = 1290 if mp_name == "Andri Þór Sturluson"
replace gender = "M" if mp_name == "Andri Þór Sturluson"
replace party = "Píratar" if mp_name == "Andri Þór Sturluson"
replace finished = 1 if mp_name == "Andri Þór Sturluson"

replace MP_id = 1234 if mp_name == "Andrés Ingi Jónsson"
replace gender = "M" if mp_name == "Andrés Ingi Jónsson"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Andrés Ingi Jónsson"
replace finished = 1 if mp_name == "Andrés Ingi Jónsson"

replace MP_id = 1326 if mp_name == "Anna Kolbrún Árnadóttir"
replace gender = "F" if mp_name == "Anna Kolbrún Árnadóttir"
replace party = "Miðflokkurinn" if mp_name == "Anna Kolbrún Árnadóttir"
replace finished = 1 if mp_name == "Anna Kolbrún Árnadóttir"

replace MP_id = 648 if mp_name == "Anna Kristín Gunnarsdóttir"
replace gender = "F" if mp_name == "Anna Kristín Gunnarsdóttir"
replace party = "Samfylkingin" if mp_name == "Anna Kristín Gunnarsdóttir" & sessionnum == 129
replace finished = 1 if mp_name == "Anna Kristín Gunnarsdóttir"

replace MP_id = 1011 if mp_name == "Anna Pála Sverrisdóttir"
replace gender = "F" if mp_name == "Anna Pála Sverrisdóttir"
replace party = "Samfylkingin" if mp_name == "Anna Pála Sverrisdóttir"
replace finished = 1 if mp_name == "Anna Pála Sverrisdóttir"

replace MP_id = 21 if mp_name == "Anna Ólafsdóttir Björnsson"
replace gender = "F" if mp_name == "Anna Ólafsdóttir Björnsson"
replace party = "Samtök um kvennalista" if mp_name == "Anna Ólafsdóttir Björnsson"
replace finished = 1 if mp_name == "Anna Ólafsdóttir Björnsson"

replace MP_id = 1249 if mp_name == "Ari Trausti Guðmundsson"
replace gender = "M" if mp_name == "Ari Trausti Guðmundsson"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Ari Trausti Guðmundsson"
replace finished = 1 if mp_name == "Ari Trausti Guðmundsson"

replace MP_id = 2 if mp_name == "Arnbjörg Sveinsdóttir"
replace gender = "F" if mp_name == "Arnbjörg Sveinsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Arnbjörg Sveinsdóttir"
replace finished = 1 if mp_name == "Arnbjörg Sveinsdóttir"

replace MP_id = 1007 if mp_name == "Arndís Soffía Sigurðardóttir"
replace gender = "F" if mp_name == "Arndís Soffía Sigurðardóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Arndís Soffía Sigurðardóttir"
replace finished = 1 if mp_name == "Arndís Soffía Sigurðardóttir"

replace MP_id = 745 if mp_name == "Arnþrúður Karlsdóttir"
replace gender = "F" if mp_name == "Arnþrúður Karlsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Arnþrúður Karlsdóttir"
replace finished = 1 if mp_name == "Arnþrúður Karlsdóttir"

replace MP_id = 675 if mp_name == "Atli Gíslason"
replace gender = "M" if mp_name == "Atli Gíslason"
*replace party = "utan flokka" if mp_name == "Atli Gíslason"
replace finished = 1 if mp_name == "Atli Gíslason"

replace MP_id = 1000 if mp_name == "Auður Lilja Erlingsdóttir"
replace gender = "F" if mp_name == "Auður Lilja Erlingsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Auður Lilja Erlingsdóttir"
replace finished = 1 if mp_name == "Auður Lilja Erlingsdóttir"

replace MP_id = 747 if mp_name == "Auður Sveinsdóttir"
replace gender = "F" if mp_name == "Auður Sveinsdóttir"
replace party = "Alþýðubandalagið" if mp_name == "Auður Sveinsdóttir"
replace finished = 1 if mp_name == "Auður Sveinsdóttir"

replace MP_id = 1126 if mp_name == "Baldvin Jónsson"
replace gender = "M" if mp_name == "Baldvin Jónsson"
replace party = "Hreyfingin" if mp_name == "Baldvin Jónsson"
replace finished = 1 if mp_name == "Baldvin Jónsson"

replace MP_id = 1248 if mp_name == "Benedikt Jóhannesson"
replace gender = "M" if mp_name == "Benedikt Jóhannesson"
replace party = "Viðreisn" if mp_name == "Benedikt Jóhannesson"
replace finished = 1 if mp_name == "Benedikt Jóhannesson"

replace MP_id = 1327 if mp_name == "Bergþór Ólason"
replace gender = "M" if mp_name == "Bergþór Ólason"
replace party = "Miðflokkurinn" if mp_name == "Bergþór Ólason"
replace finished = 1 if mp_name == "Bergþór Ólason"

replace MP_id = 650 if mp_name == "Birgir Ármannsson"
replace gender = "M" if mp_name == "Birgir Ármannsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Birgir Ármannsson"
replace finished = 1 if mp_name == "Birgir Ármannsson"

replace MP_id = 1129 if mp_name == "Birgir Þórarinsson"
replace gender = "M" if mp_name == "Birgir Þórarinsson"
replace party = "Miðflokkurinn" if mp_name == "Birgir Þórarinsson" & sessionnum == 149
replace finished = 1 if mp_name == "Birgir Þórarinsson"

replace MP_id = 728 if mp_name == "Birgitta Jónsdóttir"
replace gender = "F" if mp_name == "Birgitta Jónsdóttir"
*replace party = "Píratar" if mp_name == "Birgitta Jónsdóttir"
replace finished = 1 if mp_name == "Birgitta Jónsdóttir"

replace MP_id = 651 if mp_name == "Birkir Jón Jónsson"
replace gender = "M" if mp_name == "Birkir Jón Jónsson"
replace party = "Framsóknarflokkur" if mp_name == "Birkir Jón Jónsson"
replace finished = 1 if mp_name == "Birkir Jón Jónsson"

replace MP_id = 1012 if mp_name == "Bjarkey Olsen Gunnarsdóttir"
replace gender = "F" if mp_name == "Bjarkey Olsen Gunnarsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Bjarkey Olsen Gunnarsdóttir"
replace finished = 1 if mp_name == "Bjarkey Olsen Gunnarsdóttir"

replace MP_id = 652 if mp_name == "Bjarni Benediktsson"
replace gender = "M" if mp_name == "Bjarni Benediktsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Bjarni Benediktsson"
replace finished = 1 if mp_name == "Bjarni Benediktsson"

replace MP_id = 680 if mp_name == "Bjarni Harðarson"
replace gender = "M" if mp_name == "Bjarni Harðarson"
replace party = "Framsóknarflokkur" if mp_name == "Bjarni Harðarson"
replace finished = 1 if mp_name == "Bjarni Harðarson"

replace MP_id = 653 if mp_name == "Björgvin G. Sigurðsson"
replace gender = "M" if mp_name == "Björgvin G. Sigurðsson"
replace party = "Samfylkingin" if mp_name == "Björgvin G. Sigurðsson"
replace finished = 1 if mp_name == "Björgvin G. Sigurðsson"

replace MP_id = 681 if mp_name == "Björk Guðjónsdóttir"
replace gender = "F" if mp_name == "Björk Guðjónsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Björk Guðjónsdóttir"
replace finished = 1 if mp_name == "Björk Guðjónsdóttir"

replace MP_id = 765 if mp_name == "Björk Jóhannsdóttir"
replace gender = "F" if mp_name == "Björk Jóhannsdóttir"
replace party = "Samtök um kvennalista" if mp_name == "Björk Jóhannsdóttir"
replace finished = 1 if mp_name == "Björk Jóhannsdóttir"

replace MP_id = 76 if mp_name == "Björn Bjarnason"
replace gender = "M" if mp_name == "Björn Bjarnason"
replace party = "Sjálfstæðisflokkur" if mp_name == "Björn Bjarnason"
replace finished = 1 if mp_name == "Björn Bjarnason"

replace MP_id = 1044 if mp_name == "Björn Ingi Hrafnsson"
replace gender = "M" if mp_name == "Björn Ingi Hrafnsson"
replace party = "Framsóknarflokkur" if mp_name == "Björn Ingi Hrafnsson"
replace finished = 1 if mp_name == "Björn Ingi Hrafnsson"

replace MP_id = 1215 if mp_name == "Björn Leví Gunnarsson"
replace gender = "M" if mp_name == "Björn Leví Gunnarsson"
replace party = "Píratar" if mp_name == "Björn Leví Gunnarsson"
replace finished = 1 if mp_name == "Björn Leví Gunnarsson"

replace MP_id = 737 if mp_name == "Björn Valur Gíslason"
replace gender = "M" if mp_name == "Björn Valur Gíslason"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Björn Valur Gíslason"
replace finished = 1 if mp_name == "Björn Valur Gíslason"

replace MP_id = 1158 if mp_name == "Björt Ólafsdóttir"
replace gender = "F" if mp_name == "Björt Ólafsdóttir"
replace party = "Björt framtíð" if mp_name == "Björt Ólafsdóttir"
replace finished = 1 if mp_name == "Björt Ólafsdóttir"

replace MP_id = 1096 if mp_name == "Bryndís Guðmundsdóttir"
replace gender = "F" if mp_name == "Bryndís Guðmundsdóttir"
replace party = "Samtök um kvennalista" if mp_name == "Bryndís Guðmundsdóttir"
replace finished = 1 if mp_name == "Bryndís Guðmundsdóttir"

replace MP_id = 1039 if mp_name == "Bryndís Haraldsdóttir"
replace gender = "F" if mp_name == "Bryndís Haraldsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Bryndís Haraldsdóttir"
replace finished = 1 if mp_name == "Bryndís Haraldsdóttir"

replace MP_id = 98 if mp_name == "Bryndís Hlöðversdóttir"
replace gender = "F" if mp_name == "Bryndís Hlöðversdóttir"
replace party = "Samfylkingin" if mp_name == "Bryndís Hlöðversdóttir" & sessionnum>=124 //https://www.althingi.is/pdf/Frambodslistar1999doc.PDF
replace finished = 1 if mp_name == "Bryndís Hlöðversdóttir"

replace MP_id = 1159 if mp_name == "Brynhildur Pétursdóttir"
replace gender = "F" if mp_name == "Brynhildur Pétursdóttir"
replace party = "Björt framtíð" if mp_name == "Brynhildur Pétursdóttir"
replace finished = 1 if mp_name == "Brynhildur Pétursdóttir"

replace MP_id = 1186 if mp_name == "Brynhildur S. Björnsdóttir"
replace gender = "F" if mp_name == "Brynhildur S. Björnsdóttir"
replace party = "Björt framtíð" if mp_name == "Brynhildur S. Björnsdóttir"
replace finished = 1 if mp_name == "Brynhildur S. Björnsdóttir"

replace MP_id = 1107 if mp_name == "Brynja Magnúsdóttir"
replace gender = "F" if mp_name == "Brynja Magnúsdóttir"
replace party = "Samfylkingin" if mp_name == "Brynja Magnúsdóttir"
replace finished = 1 if mp_name == "Brynja Magnúsdóttir"

replace MP_id = 1160 if mp_name == "Brynjar Níelsson"
replace gender = "M" if mp_name == "Brynjar Níelsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Brynjar Níelsson"
replace finished = 1 if mp_name == "Brynjar Níelsson"

replace MP_id = 1108 if mp_name == "Böðvar Jónsson"
replace gender = "M" if mp_name == "Böðvar Jónsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Böðvar Jónsson"
replace finished = 1 if mp_name == "Böðvar Jónsson"

replace MP_id = 654 if mp_name == "Dagný Jónsdóttir"
replace gender = "F" if mp_name == "Dagný Jónsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Dagný Jónsdóttir"
replace finished = 1 if mp_name == "Dagný Jónsdóttir"

replace MP_id = 106 if mp_name == "Davíð Oddsson"
replace gender = "M" if mp_name == "Davíð Oddsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Davíð Oddsson"
replace finished = 1 if mp_name == "Davíð Oddsson" //https://is.wikipedia.org/wiki/Kj%C3%B6rnir_al%C3%BEingismenn_1995

replace MP_id = 1010 if mp_name == "Davíð Stefánsson"
replace gender = "M" if mp_name == "Davíð Stefánsson"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Davíð Stefánsson"
replace finished = 1 if mp_name == "Davíð Stefánsson"

replace MP_id = 109 if mp_name == "Drífa Hjartardóttir"
replace gender = "F" if mp_name == "Drífa Hjartardóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Drífa Hjartardóttir"
replace finished = 1 if mp_name == "Drífa Hjartardóttir"

replace MP_id = 782 if mp_name == "Drífa J. Sigfúsdóttir"
replace gender = "F" if mp_name == "Drífa J. Sigfúsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Drífa J. Sigfúsdóttir"
replace finished = 1 if mp_name == "Drífa J. Sigfúsdóttir"

replace MP_id = 1097 if mp_name == "Dóra Líndal Hjartardóttir"
replace gender = "F" if mp_name == "Dóra Líndal Hjartardóttir"
replace party = "Samfylkingin" if mp_name == "Dóra Líndal Hjartardóttir"
replace finished = 1 if mp_name == "Dóra Líndal Hjartardóttir"

replace MP_id = 1014 if mp_name == "Dögg Pálsdóttir"
replace gender = "F" if mp_name == "Dögg Pálsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Dögg Pálsdóttir"
replace finished = 1 if mp_name == "Dögg Pálsdóttir"

replace MP_id = 1032 if mp_name == "Dýrleif Skjóldal"
replace gender = "F" if mp_name == "Dýrleif Skjóldal"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Dýrleif Skjóldal"
replace finished = 1 if mp_name == "Dýrleif Skjóldal"

replace MP_id = 1185 if mp_name == "Edward H. Huijbens"
replace gender = "M" if mp_name == "Edward H. Huijbens"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Edward H. Huijbens"
replace finished = 1 if mp_name == "Edward H. Huijbens"

replace MP_id = 113 if mp_name == "Eggert Haukdal"
replace gender = "M" if mp_name == "Eggert Haukdal"
replace party = "Sjálfstæðisflokkur" if mp_name == "Eggert Haukdal"
replace finished = 1 if mp_name == "Eggert Haukdal"

replace MP_id = 117 if mp_name == "Egill Jónsson"
replace gender = "M" if mp_name == "Egill Jónsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Egill Jónsson"
replace finished = 1 if mp_name == "Egill Jónsson"

replace MP_id = 1274 if mp_name == "Einar Brynjólfsson"
replace gender = "M" if mp_name == "Einar Brynjólfsson"
replace party = "Píratar" if mp_name == "Einar Brynjólfsson"
replace finished = 1 if mp_name == "Einar Brynjólfsson"

replace MP_id = 124 if mp_name == "Einar K. Guðfinnsson"
replace gender = "M" if mp_name == "Einar K. Guðfinnsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Einar K. Guðfinnsson"
replace finished = 1 if mp_name == "Einar K. Guðfinnsson"

replace MP_id = 1109 if mp_name == "Einar Karl Haraldsson"
replace gender = "M" if mp_name == "Einar Karl Haraldsson"
replace party = "Samfylkingin" if mp_name == "Einar Karl Haraldsson"
replace finished = 1 if mp_name == "Einar Karl Haraldsson"

replace MP_id = 134 if mp_name == "Einar Már Sigurðarson"
replace gender = "M" if mp_name == "Einar Már Sigurðarson"
replace party = "Samfylkingin" if mp_name == "Einar Már Sigurðarson" & sessionnum>=124 //https://www.althingi.is/pdf/Frambodslistar1999doc.PDF
replace finished = 1 if mp_name == "Einar Már Sigurðarson"

replace MP_id = 129 if mp_name == "Einar Oddur Kristjánsson"
replace gender = "M" if mp_name == "Einar Oddur Kristjánsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Einar Oddur Kristjánsson"
replace finished = 1 if mp_name == "Einar Oddur Kristjánsson"

replace MP_id = 118 if mp_name == "Eiður Guðnason"
replace gender = "M" if mp_name == "Eiður Guðnason"
replace party = "None" if mp_name == "Eiður Guðnason"
replace finished = 1 if mp_name == "Eiður Guðnason"

replace MP_id = 141 if mp_name == "Ellert B. Schram"
replace gender = "M" if mp_name == "Ellert B. Schram"
replace party = "Samfylkingin" if mp_name == "Ellert B. Schram"
replace finished = 1 if mp_name == "Ellert B. Schram"

replace MP_id = 1161 if mp_name == "Elsa Lára Arnardóttir"
replace gender = "F" if mp_name == "Elsa Lára Arnardóttir"
replace party = "Framsóknarflokkur" if mp_name == "Elsa Lára Arnardóttir"
replace finished = 1 if mp_name == "Elsa Lára Arnardóttir"

replace MP_id = 1181 if mp_name == "Elín Hirst"
replace gender = "F" if mp_name == "Elín Hirst"
replace party = "Sjálfstæðisflokkur" if mp_name == "Elín Hirst"
replace finished = 1 if mp_name == "Elín Hirst"

replace MP_id = 790 if mp_name == "Elín R. Líndal"
replace gender = "F" if mp_name == "Elín R. Líndal"
replace party = "Framsóknarflokkur" if mp_name == "Elín R. Líndal"
replace finished = 1 if mp_name == "Elín R. Líndal"

replace MP_id = 791 if mp_name == "Elínbjörg Magnúsdóttir"
replace gender = "F" if mp_name == "Elínbjörg Magnúsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Elínbjörg Magnúsdóttir"
replace finished = 1 if mp_name == "Elínbjörg Magnúsdóttir"

replace MP_id = 1005 if mp_name == "Erla Ósk Ásgeirsdóttir"
replace gender = "F" if mp_name == "Erla Ósk Ásgeirsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Erla Ósk Ásgeirsdóttir"
replace finished = 1 if mp_name == "Erla Ósk Ásgeirsdóttir"

replace MP_id = 1253 if mp_name == "Eva Pandora Baldursdóttir"
replace gender = "F" if mp_name == "Eva Pandora Baldursdóttir"
replace party = "Píratar" if mp_name == "Eva Pandora Baldursdóttir"
replace finished = 1 if mp_name == "Eva Pandora Baldursdóttir"

replace MP_id = 703 if mp_name == "Eygló Harðardóttir"
replace gender = "F" if mp_name == "Eygló Harðardóttir"
replace party = "Framsóknarflokkur" if mp_name == "Eygló Harðardóttir"
replace finished = 1 if mp_name == "Eygló Harðardóttir"

replace MP_id = 147 if mp_name == "Eyjólfur Konráð Jónsson"
replace gender = "M" if mp_name == "Eyjólfur Konráð Jónsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Eyjólfur Konráð Jónsson"
replace finished = 1 if mp_name == "Eyjólfur Konráð Jónsson"

replace MP_id = 1224 if mp_name == "Eyrún Eyþórsdóttir"
replace gender = "F" if mp_name == "Eyrún Eyþórsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Eyrún Eyþórsdóttir"
replace finished = 1 if mp_name == "Eyrún Eyþórsdóttir"

replace MP_id = 1149 if mp_name == "Eyrún Ingibjörg Sigþórsdóttir"
replace gender = "F" if mp_name == "Eyrún Ingibjörg Sigþórsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Eyrún Ingibjörg Sigþórsdóttir"
replace finished = 1 if mp_name == "Eyrún Ingibjörg Sigþórsdóttir"

replace MP_id = 150 if mp_name == "Finnur Ingólfsson"
replace gender = "M" if mp_name == "Finnur Ingólfsson"
replace party = "Framsóknarflokkur" if mp_name == "Finnur Ingólfsson"
replace finished = 1 if mp_name == "Finnur Ingólfsson"

replace MP_id = 1188 if mp_name == "Freyja Haraldsdóttir"
replace gender = "F" if mp_name == "Freyja Haraldsdóttir"
replace party = "Björt framtíð" if mp_name == "Freyja Haraldsdóttir"
replace finished = 1 if mp_name == "Freyja Haraldsdóttir"

replace MP_id = 156 if mp_name == "Friðrik Sophusson"
replace gender = "M" if mp_name == "Friðrik Sophusson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Friðrik Sophusson"
replace finished = 1 if mp_name == "Friðrik Sophusson"

replace MP_id = 1162 if mp_name == "Frosti Sigurjónsson"
replace gender = "M" if mp_name == "Frosti Sigurjónsson"
replace party = "Framsóknarflokkur" if mp_name == "Frosti Sigurjónsson"
replace finished = 1 if mp_name == "Frosti Sigurjónsson"

replace MP_id = 162 if mp_name == "Geir H. Haarde"
replace gender = "M" if mp_name == "Geir H. Haarde"
replace party = "Sjálfstæðisflokkur" if mp_name == "Geir H. Haarde"
replace finished = 1 if mp_name == "Geir H. Haarde"

replace MP_id = 682 if mp_name == "Grétar Mar Jónsson"
replace gender = "M" if mp_name == "Grétar Mar Jónsson"
replace party = "Frjálslyndi flokkurinn" if mp_name == "Grétar Mar Jónsson"
replace finished = 1 if mp_name == "Grétar Mar Jónsson"

replace MP_id = 205 if mp_name == "Gunnar Birgisson"
replace gender = "M" if mp_name == "Gunnar Birgisson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Gunnar Birgisson"
replace finished = 1 if mp_name == "Gunnar Birgisson"

replace MP_id = 722 if mp_name == "Gunnar Bragi Sveinsson"
replace gender = "M" if mp_name == "Gunnar Bragi Sveinsson"
replace party = "Miðflokkurinn" if mp_name == "Gunnar Bragi Sveinsson" & sessionnum>=148
replace finished = 1 if mp_name == "Gunnar Bragi Sveinsson"

replace MP_id = 1262 if mp_name == "Gunnar Hrafn Jónsson"
replace gender = "M" if mp_name == "Gunnar Hrafn Jónsson"
replace party = "Píratar" if mp_name == "Gunnar Hrafn Jónsson"
replace finished = 1 if mp_name == "Gunnar Hrafn Jónsson"

replace MP_id = 1285 if mp_name == "Gunnar Ingiberg Guðmundsson"
replace gender = "M" if mp_name == "Gunnar Ingiberg Guðmundsson"
replace party = "Píratar" if mp_name == "Gunnar Ingiberg Guðmundsson"
replace finished = 1 if mp_name == "Gunnar Ingiberg Guðmundsson"

replace MP_id = 1062 if mp_name == "Gunnar Pálsson"
replace gender = "M" if mp_name == "Gunnar Pálsson"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Gunnar Pálsson"
replace finished = 1 if mp_name == "Gunnar Pálsson"

replace MP_id = 685 if mp_name == "Gunnar Svavarsson"
replace gender = "M" if mp_name == "Gunnar Svavarsson"
replace party = "Samfylkingin" if mp_name == "Gunnar Svavarsson"
replace finished = 1 if mp_name == "Gunnar Svavarsson"

replace MP_id = 1061 if mp_name == "Gunnar Ólafsson"
replace gender = "M" if mp_name == "Gunnar Ólafsson"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Gunnar Ólafsson"
replace finished = 1 if mp_name == "Gunnar Ólafsson"

replace MP_id = 657 if mp_name == "Gunnar Örlygsson"
replace gender = "M" if mp_name == "Gunnar Örlygsson"
replace party = "Frjálslyndi flokkurinn" if mp_name == "Gunnar Örlygsson" & sessionnum <= 130
replace finished = 1 if mp_name == "Gunnar Örlygsson"

replace MP_id = 215 if mp_name == "Gunnlaugur M. Sigmundsson"
replace gender = "M" if mp_name == "Gunnlaugur M. Sigmundsson"
*replace party = "Framsóknarflokkur" if mp_name == "Gunnlaugur M. Sigmundsson"
replace finished = 1 if mp_name == "Gunnlaugur M. Sigmundsson"

replace MP_id = 216 if mp_name == "Gunnlaugur Stefánsson"
replace gender = "M" if mp_name == "Gunnlaugur Stefánsson"
*replace party = "Samfylkingin" if mp_name == "Gunnlaugur Stefánsson" // weird that he has record for 127, potentially a confusion with his brother (id = 7), but let's leave it as is.
replace finished = 1 if mp_name == "Gunnlaugur Stefánsson"

replace MP_id = 683 if mp_name == "Guðbjartur Hannesson"
replace gender = "M" if mp_name == "Guðbjartur Hannesson"
replace party = "Samfylkingin" if mp_name == "Guðbjartur Hannesson"
replace finished = 1 if mp_name == "Guðbjartur Hannesson"

replace MP_id = 684 if mp_name == "Guðfinna S. Bjarnadóttir"
replace gender = "F" if mp_name == "Guðfinna S. Bjarnadóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Guðfinna S. Bjarnadóttir"
replace finished = 1 if mp_name == "Guðfinna S. Bjarnadóttir"

replace MP_id = 727 if mp_name == "Guðfríður Lilja Grétarsdóttir"
replace gender = "F" if mp_name == "Guðfríður Lilja Grétarsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Guðfríður Lilja Grétarsdóttir"
replace finished = 1 if mp_name == "Guðfríður Lilja Grétarsdóttir"

replace MP_id = 176 if mp_name == "Guðjón A. Kristjánsson"
replace gender = "M" if mp_name == "Guðjón A. Kristjánsson"
replace party = "Frjálslyndi flokkurinn" if mp_name == "Guðjón A. Kristjánsson" & sessionnum >= 124
replace finished = 1 if mp_name == "Guðjón A. Kristjánsson"

replace MP_id = 175 if mp_name == "Guðjón Guðmundsson"
replace gender = "M" if mp_name == "Guðjón Guðmundsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Guðjón Guðmundsson"
replace finished = 1 if mp_name == "Guðjón Guðmundsson"

replace MP_id = 655 if mp_name == "Guðjón Hjörleifsson"
replace gender = "M" if mp_name == "Guðjón Hjörleifsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Guðjón Hjörleifsson"
replace finished = 1 if mp_name == "Guðjón Hjörleifsson"

replace MP_id = 1257 if mp_name == "Guðjón S. Brjánsson"
replace gender = "M" if mp_name == "Guðjón S. Brjánsson"
replace party = "Samfylkingin" if mp_name == "Guðjón S. Brjánsson"
replace finished = 1 if mp_name == "Guðjón S. Brjánsson"

replace MP_id = 670 if mp_name == "Guðjón Ólafur Jónsson"
replace gender = "M" if mp_name == "Guðjón Ólafur Jónsson"
replace party = "Framsóknarflokkur" if mp_name == "Guðjón Ólafur Jónsson"
replace finished = 1 if mp_name == "Guðjón Ólafur Jónsson"

replace MP_id = 656 if mp_name == "Guðlaugur Þór Þórðarson"
replace gender = "M" if mp_name == "Guðlaugur Þór Þórðarson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Guðlaugur Þór Þórðarson"
replace finished = 1 if mp_name == "Guðlaugur Þór Þórðarson"

replace MP_id = 1328 if mp_name == "Guðmundur Andri Thorsson"
replace gender = "M" if mp_name == "Guðmundur Andri Thorsson"
replace party = "Samfylkingin" if mp_name == "Guðmundur Andri Thorsson"
replace finished = 1 if mp_name == "Guðmundur Andri Thorsson"

replace MP_id = 181 if mp_name == "Guðmundur Bjarnason"
replace gender = "M" if mp_name == "Guðmundur Bjarnason"
replace party = "Framsóknarflokkur" if mp_name == "Guðmundur Bjarnason"
replace finished = 1 if mp_name == "Guðmundur Bjarnason"

replace MP_id = 187 if mp_name == "Guðmundur H. Garðarsson"
replace gender = "M" if mp_name == "Guðmundur H. Garðarsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Guðmundur H. Garðarsson"
replace finished = 1 if mp_name == "Guðmundur H. Garðarsson"

replace MP_id = 191 if mp_name == "Guðmundur Hallvarðsson"
replace gender = "M" if mp_name == "Guðmundur Hallvarðsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Guðmundur Hallvarðsson"
replace finished = 1 if mp_name == "Guðmundur Hallvarðsson"

replace MP_id = 1335 if mp_name == "Guðmundur Ingi Guðbrandsson"
replace gender = "M" if mp_name == "Guðmundur Ingi Guðbrandsson"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Guðmundur Ingi Guðbrandsson"
replace finished = 1 if mp_name == "Guðmundur Ingi Guðbrandsson"

replace MP_id = 1329 if mp_name == "Guðmundur Ingi Kristinsson"
replace gender = "M" if mp_name == "Guðmundur Ingi Kristinsson"
replace party = "Flokkur fólksins" if mp_name == "Guðmundur Ingi Kristinsson"
replace finished = 1 if mp_name == "Guðmundur Ingi Kristinsson"

replace MP_id = 1020 if mp_name == "Guðmundur Magnússon"
replace gender = "M" if mp_name == "Guðmundur Magnússon"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Guðmundur Magnússon"
replace finished = 1 if mp_name == "Guðmundur Magnússon"

replace MP_id = 805 if mp_name == "Guðmundur Stefánsson"
replace gender = "M" if mp_name == "Guðmundur Stefánsson"
replace party = "Framsóknarflokkur" if mp_name == "Guðmundur Stefánsson"
replace finished = 1 if mp_name == "Guðmundur Stefánsson"

replace MP_id = 704 if mp_name == "Guðmundur Steingrímsson"
replace gender = "M" if mp_name == "Guðmundur Steingrímsson"
*replace party = "utan flokka" if mp_name == "Guðmundur Steingrímsson"
replace finished = 1 if mp_name == "Guðmundur Steingrímsson"

replace MP_id = 7 if mp_name == "Guðmundur Árni Stefánsson"
replace gender = "M" if mp_name == "Guðmundur Árni Stefánsson"
replace party = "Alþýðuflokkur" if mp_name == "Guðmundur Árni Stefánsson" & sessionnum <= 120
replace party = "Samfylkingin" if mp_name == "Guðmundur Árni Stefánsson" & sessionnum >= 124
replace finished = 1 if mp_name == "Guðmundur Árni Stefánsson"

replace MP_id = 802 if mp_name == "Guðmundur Þ Jónsson"
replace gender = "M" if mp_name == "Guðmundur Þ Jónsson"
replace party = "Alþýðubandalagið" if mp_name == "Guðmundur Þ Jónsson"
replace finished = 1 if mp_name == "Guðmundur Þ Jónsson"

replace MP_id = 198 if mp_name == "Guðni Ágústsson"
replace gender = "M" if mp_name == "Guðni Ágústsson"
replace party = "Framsóknarflokkur" if mp_name == "Guðni Ágústsson"
replace finished = 1 if mp_name == "Guðni Ágústsson"

replace MP_id = 199 if mp_name == "Guðný Guðbjörnsdóttir"
replace gender = "F" if mp_name == "Guðný Guðbjörnsdóttir"
replace party = "Samtök um kvennalista" if mp_name == "Guðný Guðbjörnsdóttir"
replace finished = 1 if mp_name == "Guðný Guðbjörnsdóttir"

replace MP_id = 1008 if mp_name == "Guðrún Erlingsdóttir"
replace gender = "F" if mp_name == "Guðrún Erlingsdóttir"
replace party = "Samfylkingin" if mp_name == "Guðrún Erlingsdóttir"
replace finished = 1 if mp_name == "Guðrún Erlingsdóttir"

replace MP_id = 202 if mp_name == "Guðrún Helgadóttir"
replace gender = "F" if mp_name == "Guðrún Helgadóttir"
replace party = "Alþýðubandalagið" if mp_name == "Guðrún Helgadóttir"
replace finished = 1 if mp_name == "Guðrún Helgadóttir"

replace MP_id = 201 if mp_name == "Guðrún J. Halldórsdóttir"
replace gender = "F" if mp_name == "Guðrún J. Halldórsdóttir"
replace party = "Samtök um kvennalista" if mp_name == "Guðrún J. Halldórsdóttir"
replace finished = 1 if mp_name == "Guðrún J. Halldórsdóttir"

replace MP_id = 204 if mp_name == "Guðrún Ögmundsdóttir"
replace gender = "F" if mp_name == "Guðrún Ögmundsdóttir"
replace party = "Samfylkingin" if mp_name == "Guðrún Ögmundsdóttir"
replace finished = 1 if mp_name == "Guðrún Ögmundsdóttir"

replace MP_id = 735 if mp_name == "Gylfi Magnússon"
replace gender = "M" if mp_name == "Gylfi Magnússon"
replace party = "None" if mp_name == "Gylfi Magnússon"
replace finished = 1 if mp_name == "Gylfi Magnússon"

replace MP_id = 166 if mp_name == "Gísli S. Einarsson"
replace gender = "M" if mp_name == "Gísli S. Einarsson"
replace party = "Alþýðuflokkur" if mp_name == "Gísli S. Einarsson" & sessionnum <= 120
replace party = "Samfylkingin" if mp_name == "Gísli S. Einarsson" & sessionnum >= 124
replace finished = 1 if mp_name == "Gísli S. Einarsson"

replace MP_id = 1330 if mp_name == "Halla Signý Kristjánsdóttir"
replace gender = "F" if mp_name == "Halla Signý Kristjánsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Halla Signý Kristjánsdóttir"
replace finished = 1 if mp_name == "Halla Signý Kristjánsdóttir"

replace MP_id = 12 if mp_name == "Halldór Blöndal"
replace gender = "M" if mp_name == "Halldór Blöndal"
replace party = "Sjálfstæðisflokkur" if mp_name == "Halldór Blöndal"
replace finished = 1 if mp_name == "Halldór Blöndal"

replace MP_id = 8 if mp_name == "Halldór Ásgrímsson"
replace gender = "M" if mp_name == "Halldór Ásgrímsson"
replace party = "Framsóknarflokkur" if mp_name == "Halldór Ásgrímsson"
replace finished = 1 if mp_name == "Halldór Ásgrímsson"

replace MP_id = 1127 if mp_name == "Halldóra Lóa Þorvaldsdóttir"
replace gender = "F" if mp_name == "Halldóra Lóa Þorvaldsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Halldóra Lóa Þorvaldsdóttir"
replace finished = 1 if mp_name == "Halldóra Lóa Þorvaldsdóttir"

replace MP_id = 1218 if mp_name == "Halldóra Mogensen"
replace gender = "F" if mp_name == "Halldóra Mogensen"
replace party = "Píratar" if mp_name == "Halldóra Mogensen"
replace finished = 1 if mp_name == "Halldóra Mogensen"

replace MP_id = 1029 if mp_name == "Hanna Birna Jóhannsdóttir"
replace gender = "F" if mp_name == "Hanna Birna Jóhannsdóttir"
replace party = "Frjálslyndi flokkurinn" if mp_name == "Hanna Birna Jóhannsdóttir"
replace finished = 1 if mp_name == "Hanna Birna Jóhannsdóttir"

replace MP_id = 1163 if mp_name == "Hanna Birna Kristjánsdóttir"
replace gender = "F" if mp_name == "Hanna Birna Kristjánsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Hanna Birna Kristjánsdóttir"
replace finished = 1 if mp_name == "Hanna Birna Kristjánsdóttir"

replace MP_id = 1276 if mp_name == "Hanna Katrín Friðriksson"
replace gender = "F" if mp_name == "Hanna Katrín Friðriksson"
replace party = "Viðreisn" if mp_name == "Hanna Katrín Friðriksson"
replace finished = 1 if mp_name == "Hanna Katrín Friðriksson"

replace MP_id = 1164 if mp_name == "Haraldur Benediktsson"
replace gender = "M" if mp_name == "Haraldur Benediktsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Haraldur Benediktsson"
replace finished = 1 if mp_name == "Haraldur Benediktsson"

replace MP_id = 1165 if mp_name == "Haraldur Einarsson"
replace gender = "M" if mp_name == "Haraldur Einarsson"
replace party = "Framsóknarflokkur" if mp_name == "Haraldur Einarsson"
replace finished = 1 if mp_name == "Haraldur Einarsson"

replace MP_id = 1213 if mp_name == "Heiða Kristín Helgadóttir"
replace gender = "F" if mp_name == "Heiða Kristín Helgadóttir"
replace party = "Björt framtíð" if mp_name == "Heiða Kristín Helgadóttir"
replace finished = 1 if mp_name == "Heiða Kristín Helgadóttir"

replace MP_id = 1065 if mp_name == "Helga Guðrún Jónasdóttir"
replace gender = "F" if mp_name == "Helga Guðrún Jónasdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Helga Guðrún Jónasdóttir"
replace finished = 1 if mp_name == "Helga Guðrún Jónasdóttir"

replace MP_id = 702 if mp_name == "Helga Sigrún Harðardóttir"
replace gender = "F" if mp_name == "Helga Sigrún Harðardóttir"
replace party = "Framsóknarflokkur" if mp_name == "Helga Sigrún Harðardóttir"
replace finished = 1 if mp_name == "Helga Sigrún Harðardóttir"

replace MP_id = 1331 if mp_name == "Helga Vala Helgadóttir"
replace gender = "F" if mp_name == "Helga Vala Helgadóttir"
replace party = "Samfylkingin" if mp_name == "Helga Vala Helgadóttir"
replace finished = 1 if mp_name == "Helga Vala Helgadóttir"

replace MP_id = 658 if mp_name == "Helgi Hjörvar"
replace gender = "M" if mp_name == "Helgi Hjörvar"
replace party = "Samfylkingin" if mp_name == "Helgi Hjörvar"
replace finished = 1 if mp_name == "Helgi Hjörvar"

replace MP_id = 1166 if mp_name == "Helgi Hrafn Gunnarsson"
replace gender = "M" if mp_name == "Helgi Hrafn Gunnarsson"
replace party = "Píratar" if mp_name == "Helgi Hrafn Gunnarsson"
replace finished = 1 if mp_name == "Helgi Hrafn Gunnarsson"

replace MP_id = 700 if mp_name == "Herdís Þórðardóttir"
replace gender = "F" if mp_name == "Herdís Þórðardóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Herdís Þórðardóttir"
replace finished = 1 if mp_name == "Herdís Þórðardóttir"

replace MP_id = 834 if mp_name == "Hermann Níelsson"
replace gender = "M" if mp_name == "Hermann Níelsson"
replace party = "Alþýðuflokkur" if mp_name == "Hermann Níelsson"
replace finished = 1 if mp_name == "Hermann Níelsson"

replace MP_id = 1279 if mp_name == "Hildur Sverrisdóttir"
replace gender = "F" if mp_name == "Hildur Sverrisdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Hildur Sverrisdóttir"
replace finished = 1 if mp_name == "Hildur Sverrisdóttir"

replace MP_id = 252 if mp_name == "Hjálmar Jónsson"
replace gender = "M" if mp_name == "Hjálmar Jónsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Hjálmar Jónsson"
replace finished = 1 if mp_name == "Hjálmar Jónsson"

replace MP_id = 251 if mp_name == "Hjálmar Árnason"
replace gender = "M" if mp_name == "Hjálmar Árnason"
replace party = "Framsóknarflokkur" if mp_name == "Hjálmar Árnason"
replace finished = 1 if mp_name == "Hjálmar Árnason"

replace MP_id = 1113 if mp_name == "Hjördís Þóra Sigurþórsdóttir"
replace gender = "F" if mp_name == "Hjördís Þóra Sigurþórsdóttir"
replace party = "Samfylkingin" if mp_name == "Hjördís Þóra Sigurþórsdóttir"
replace finished = 1 if mp_name == "Hjördís Þóra Sigurþórsdóttir"

replace MP_id = 254 if mp_name == "Hjörleifur Guttormsson"
replace gender = "M" if mp_name == "Hjörleifur Guttormsson"
*replace party = "Þingflokkur óháðra" if mp_name == "Hjörleifur Guttormsson"
replace finished = 1 if mp_name == "Hjörleifur Guttormsson"

replace MP_id = 1048 if mp_name == "Hlynur Hallsson"
replace gender = "M" if mp_name == "Hlynur Hallsson"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Hlynur Hallsson"
replace finished = 1 if mp_name == "Hlynur Hallsson"

replace MP_id = 1027 if mp_name == "Huld Aðalbjarnardóttir"
replace gender = "F" if mp_name == "Huld Aðalbjarnardóttir"
replace party = "Framsóknarflokkur" if mp_name == "Huld Aðalbjarnardóttir"
replace finished = 1 if mp_name == "Huld Aðalbjarnardóttir"

replace MP_id = 1235 if mp_name == "Hörður Ríkharðsson"
replace gender = "M" if mp_name == "Hörður Ríkharðsson"
replace party = "Samfylkingin" if mp_name == "Hörður Ríkharðsson"
replace finished = 1 if mp_name == "Hörður Ríkharðsson"

replace MP_id = 686 if mp_name == "Höskuldur Þórhallsson"
replace gender = "M" if mp_name == "Höskuldur Þórhallsson"
replace party = "Framsóknarflokkur" if mp_name == "Höskuldur Þórhallsson"
replace finished = 1 if mp_name == "Höskuldur Þórhallsson"

replace MP_id = 687 if mp_name == "Illugi Gunnarsson"
replace gender = "M" if mp_name == "Illugi Gunnarsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Illugi Gunnarsson"
replace finished = 1 if mp_name == "Illugi Gunnarsson"

replace MP_id = 1332 if mp_name == "Inga Sæland"
replace gender = "F" if mp_name == "Inga Sæland"
replace party = "Flokkur fólksins" if mp_name == "Inga Sæland"
replace finished = 1 if mp_name == "Inga Sæland"

replace MP_id = 260 if mp_name == "Ingi Björn Albertsson"
replace gender = "M" if mp_name == "Ingi Björn Albertsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Ingi Björn Albertsson"
replace finished = 1 if mp_name == "Ingi Björn Albertsson"

replace MP_id = 1025 if mp_name == "Ingibjörg Inga Guðmundsdóttir"
replace gender = "F" if mp_name == "Ingibjörg Inga Guðmundsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Ingibjörg Inga Guðmundsdóttir"
replace finished = 1 if mp_name == "Ingibjörg Inga Guðmundsdóttir"

replace MP_id = 265 if mp_name == "Ingibjörg Pálmadóttir"
replace gender = "F" if mp_name == "Ingibjörg Pálmadóttir"
replace party = "Framsóknarflokkur" if mp_name == "Ingibjörg Pálmadóttir"
replace finished = 1 if mp_name == "Ingibjörg Pálmadóttir"

replace MP_id = 264 if mp_name == "Ingibjörg Sólrún Gísladóttir"
replace gender = "F" if mp_name == "Ingibjörg Sólrún Gísladóttir"
*replace party = "Samtök um kvennalista" if mp_name == "Ingibjörg Sólrún Gísladóttir"
replace finished = 1 if mp_name == "Ingibjörg Sólrún Gísladóttir"

replace MP_id = 1209 if mp_name == "Ingibjörg Óðinsdóttir"
replace gender = "F" if mp_name == "Ingibjörg Óðinsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Ingibjörg Óðinsdóttir"
replace finished = 1 if mp_name == "Ingibjörg Óðinsdóttir"

replace MP_id = 282 if mp_name == "Jóhann Einvarðsson"
replace gender = "M" if mp_name == "Jóhann Einvarðsson"
replace party = "Framsóknarflokkur" if mp_name == "Jóhann Einvarðsson"
replace finished = 1 if mp_name == "Jóhann Einvarðsson"

replace MP_id = 280 if mp_name == "Jóhann Ársælsson"
replace gender = "M" if mp_name == "Jóhann Ársælsson"
replace party = "Samfylkingin" if mp_name == "Jóhann Ársælsson" & sessionnum >= 124
replace finished = 1 if mp_name == "Jóhann Ársælsson"

replace MP_id = 1167 if mp_name == "Jóhanna María Sigmundsdóttir"
replace gender = "F" if mp_name == "Jóhanna María Sigmundsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Jóhanna María Sigmundsdóttir"
replace finished = 1 if mp_name == "Jóhanna María Sigmundsdóttir"

replace MP_id = 287 if mp_name == "Jóhanna Sigurðardóttir"
replace gender = "F" if mp_name == "Jóhanna Sigurðardóttir"
replace party = "Alþýðuflokkur" if mp_name == "Jóhanna Sigurðardóttir" & sessionnum <= 117 //https://en.wikipedia.org/wiki/J%C3%B3hanna_Sigur%C3%B0ard%C3%B3ttir
replace party = "Samfylkingin" if mp_name == "Jóhanna Sigurðardóttir" & sessionnum >= 124
replace finished = 1 if mp_name == "Jóhanna Sigurðardóttir"

replace MP_id = 291 if mp_name == "Jóhannes Geir Sigurgeirsson"
replace gender = "M" if mp_name == "Jóhannes Geir Sigurgeirsson"
replace party = "Framsóknarflokkur" if mp_name == "Jóhannes Geir Sigurgeirsson"
replace finished = 1 if mp_name == "Jóhannes Geir Sigurgeirsson"

replace MP_id = 300 if mp_name == "Jón Baldvin Hannibalsson"
replace gender = "M" if mp_name == "Jón Baldvin Hannibalsson"
replace party = "Alþýðuflokkur" if mp_name == "Jón Baldvin Hannibalsson" & sessionnum <= 120
replace finished = 1 if mp_name == "Jón Baldvin Hannibalsson"

replace MP_id = 371 if mp_name == "Jón Bjarnason"
replace gender = "M" if mp_name == "Jón Bjarnason"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Jón Bjarnason"
replace finished = 1 if mp_name == "Jón Bjarnason"

replace MP_id = 659 if mp_name == "Jón Gunnarsson" & sessionnum <= 133
replace gender = "M" if mp_name == "Jón Gunnarsson" & sessionnum <= 133
replace party = "Samfylkingin" if mp_name == "Jón Gunnarsson" & sessionnum <= 133
replace finished = 1 if mp_name == "Jón Gunnarsson" & sessionnum <= 133

replace MP_id = 688 if mp_name == "Jón Gunnarsson" & sessionnum > 133
replace gender = "M" if mp_name == "Jón Gunnarsson" & sessionnum > 133
replace party = "Sjálfstæðisflokkur" if mp_name == "Jón Gunnarsson" & sessionnum > 133
replace finished = 1 if mp_name == "Jón Gunnarsson" & sessionnum > 133

replace MP_id = 302 if mp_name == "Jón Helgason"
replace gender = "M" if mp_name == "Jón Helgason"
replace party = "Framsóknarflokkur" if mp_name == "Jón Helgason"
replace finished = 1 if mp_name == "Jón Helgason"

replace MP_id = 1143 if mp_name == "Jón Kr. Arnarson"
replace gender = "M" if mp_name == "Jón Kr. Arnarson"
replace party = "Hreyfingin" if mp_name == "Jón Kr. Arnarson"
replace finished = 1 if mp_name == "Jón Kr. Arnarson"

replace MP_id = 1116 if mp_name == "Jón Kr. Óskarsson"
replace gender = "M" if mp_name == "Jón Kr. Óskarsson"
replace party = "Samfylkingin" if mp_name == "Jón Kr. Óskarsson"
replace finished = 1 if mp_name == "Jón Kr. Óskarsson"

replace MP_id = 10 if mp_name == "Jón Kristjánsson"
replace gender = "M" if mp_name == "Jón Kristjánsson"
replace party = "Framsóknarflokkur" if mp_name == "Jón Kristjánsson"
replace finished = 1 if mp_name == "Jón Kristjánsson"

replace MP_id = 689 if mp_name == "Jón Magnússon"
replace gender = "M" if mp_name == "Jón Magnússon"
replace party = "Frjálslyndi flokkurinn" if mp_name == "Jón Magnússon"
replace finished = 1 if mp_name == "Jón Magnússon"

replace MP_id = 337 if mp_name == "Jón Sigurðsson" & sessionnum <= 116
replace gender = "M" if mp_name == "Jón Sigurðsson" & sessionnum <= 116
replace party = "Alþýðuflokkur" if mp_name == "Jón Sigurðsson" & sessionnum <= 116
replace finished = 1 if mp_name == "Jón Sigurðsson" & sessionnum <= 116

replace MP_id = 1123 if mp_name == "Jón Sigurðsson" & sessionnum >= 133
replace gender = "M" if mp_name == "Jón Sigurðsson" & sessionnum >= 133
replace party = "None" if mp_name == "Jón Sigurðsson" & sessionnum >= 133
replace finished = 1 if mp_name == "Jón Sigurðsson" & sessionnum >= 133

replace MP_id = 1250 if mp_name == "Jón Steindór Valdimarsson"
replace gender = "M" if mp_name == "Jón Steindór Valdimarsson"
replace party = "Viðreisn" if mp_name == "Jón Steindór Valdimarsson"
replace finished = 1 if mp_name == "Jón Steindór Valdimarsson"

replace MP_id = 1168 if mp_name == "Jón Þór Ólafsson"
replace gender = "M" if mp_name == "Jón Þór Ólafsson"
replace party = "Píratar" if mp_name == "Jón Þór Ólafsson"
replace finished = 1 if mp_name == "Jón Þór Ólafsson"

replace MP_id = 1264 if mp_name == "Jóna Sólveig Elínardóttir"
replace gender = "F" if mp_name == "Jóna Sólveig Elínardóttir"
replace party = "Viðreisn" if mp_name == "Jóna Sólveig Elínardóttir"
replace finished = 1 if mp_name == "Jóna Sólveig Elínardóttir"

replace MP_id = 347 if mp_name == "Jóna Valgerður Kristjánsdóttir"
replace gender = "F" if mp_name == "Jóna Valgerður Kristjánsdóttir"
replace party = "Samtök um kvennalista" if mp_name == "Jóna Valgerður Kristjánsdóttir"
replace finished = 1 if mp_name == "Jóna Valgerður Kristjánsdóttir"

replace MP_id = 866 if mp_name == "Jónas Hallgrímsson"
replace gender = "M" if mp_name == "Jónas Hallgrímsson"
replace party = "Framsóknarflokkur" if mp_name == "Jónas Hallgrímsson"
replace finished = 1 if mp_name == "Jónas Hallgrímsson"

replace MP_id = 372 if mp_name == "Jónína Bjartmarz"
replace gender = "F" if mp_name == "Jónína Bjartmarz"
replace party = "Framsóknarflokkur" if mp_name == "Jónína Bjartmarz"
replace finished = 1 if mp_name == "Jónína Bjartmarz"

replace MP_id = 724 if mp_name == "Jónína Rós Guðmundsdóttir"
replace gender = "F" if mp_name == "Jónína Rós Guðmundsdóttir"
replace party = "Samfylkingin" if mp_name == "Jónína Rós Guðmundsdóttir"
replace finished = 1 if mp_name == "Jónína Rós Guðmundsdóttir"

replace MP_id = 1125 if mp_name == "Jórunn Einarsdóttir"
replace gender = "F" if mp_name == "Jórunn Einarsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Jórunn Einarsdóttir"
replace finished = 1 if mp_name == "Jórunn Einarsdóttir"

replace MP_id = 869 if mp_name == "Jörgína Jónsdóttir"
replace gender = "F" if mp_name == "Jörgína Jónsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Jörgína Jónsdóttir"
replace finished = 1 if mp_name == "Jörgína Jónsdóttir"

replace MP_id = 1169 if mp_name == "Karl Garðarsson"
replace gender = "M" if mp_name == "Karl Garðarsson"
replace party = "Framsóknarflokkur" if mp_name == "Karl Garðarsson"
replace finished = 1 if mp_name == "Karl Garðarsson"

replace MP_id = 1333 if mp_name == "Karl Gauti Hjaltason"
replace gender = "M" if mp_name == "Karl Gauti Hjaltason"
replace party = "Flokkur fólksins" if mp_name == "Karl Gauti Hjaltason"
replace finished = 1 if mp_name == "Karl Gauti Hjaltason"

replace MP_id = 367 if mp_name == "Karl Steinar Guðnason"
replace gender = "M" if mp_name == "Karl Steinar Guðnason"
replace party = "Alþýðuflokkur" if mp_name == "Karl Steinar Guðnason"
replace finished = 1 if mp_name == "Karl Steinar Guðnason"

replace MP_id = 373 if mp_name == "Karl V. Matthíasson"
replace gender = "M" if mp_name == "Karl V. Matthíasson"
replace party = "Samfylkingin" if mp_name == "Karl V. Matthíasson"
replace finished = 1 if mp_name == "Karl V. Matthíasson"

replace MP_id = 1297 if mp_name == "Katla Hólm Þórhildardóttir"
replace gender = "F" if mp_name == "Katla Hólm Þórhildardóttir"
replace party = "Píratar" if mp_name == "Katla Hólm Þórhildardóttir"
replace finished = 1 if mp_name == "Katla Hólm Þórhildardóttir"

replace MP_id = 1068 if mp_name == "Katrín Andrésdóttir"
replace gender = "F" if mp_name == "Katrín Andrésdóttir"
replace party = "Samfylkingin" if mp_name == "Katrín Andrésdóttir"
replace finished = 1 if mp_name == "Katrín Andrésdóttir"

replace MP_id = 374 if mp_name == "Katrín Fjeldsted"
replace gender = "F" if mp_name == "Katrín Fjeldsted"
replace party = "Sjálfstæðisflokkur" if mp_name == "Katrín Fjeldsted"
replace finished = 1 if mp_name == "Katrín Fjeldsted"

replace MP_id = 690 if mp_name == "Katrín Jakobsdóttir"
replace gender = "F" if mp_name == "Katrín Jakobsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Katrín Jakobsdóttir"
replace finished = 1 if mp_name == "Katrín Jakobsdóttir"

replace MP_id = 660 if mp_name == "Katrín Júlíusdóttir"
replace gender = "F" if mp_name == "Katrín Júlíusdóttir"
replace party = "Samfylkingin" if mp_name == "Katrín Júlíusdóttir"
replace finished = 1 if mp_name == "Katrín Júlíusdóttir"

replace MP_id = 379 if mp_name == "Kjartan Ólafsson"
replace gender = "M" if mp_name == "Kjartan Ólafsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Kjartan Ólafsson"
replace finished = 1 if mp_name == "Kjartan Ólafsson"

replace MP_id = 1265 if mp_name == "Kolbeinn Óttarsson Proppé"
replace gender = "M" if mp_name == "Kolbeinn Óttarsson Proppé"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Kolbeinn Óttarsson Proppé"
replace finished = 1 if mp_name == "Kolbeinn Óttarsson Proppé"

replace MP_id = 1049 if mp_name == "Kolbrún Baldursdóttir"
replace gender = "F" if mp_name == "Kolbrún Baldursdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Kolbrún Baldursdóttir"
replace finished = 1 if mp_name == "Kolbrún Baldursdóttir"

replace MP_id = 383 if mp_name == "Kolbrún Halldórsdóttir"
replace gender = "F" if mp_name == "Kolbrún Halldórsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Kolbrún Halldórsdóttir"
replace finished = 1 if mp_name == "Kolbrún Halldórsdóttir"

replace MP_id = 386 if mp_name == "Kristinn H. Gunnarsson"
replace gender = "M" if mp_name == "Kristinn H. Gunnarsson"
replace party = "Framsóknarflokkur" if mp_name == "Kristinn H. Gunnarsson" & inrange(sessionnum,124,133)
replace party = "Frjálslyndi flokkurinn" if mp_name == "Kristinn H. Gunnarsson" & sessionnum >= 134
replace finished = 1 if mp_name == "Kristinn H. Gunnarsson"

replace MP_id = 878 if mp_name == "Kristjana Bergsdóttir"
replace gender = "F" if mp_name == "Kristjana Bergsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Kristjana Bergsdóttir"
replace finished = 1 if mp_name == "Kristjana Bergsdóttir"

replace MP_id = 882 if mp_name == "Kristján Guðmundsson"
replace gender = "M" if mp_name == "Kristján Guðmundsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Kristján Guðmundsson"
replace finished = 1 if mp_name == "Kristján Guðmundsson"

replace MP_id = 396 if mp_name == "Kristján L. Möller"
replace gender = "M" if mp_name == "Kristján L. Möller"
replace party = "Samfylkingin" if mp_name == "Kristján L. Möller"
replace finished = 1 if mp_name == "Kristján L. Möller"

replace MP_id = 397 if mp_name == "Kristján Pálsson"
replace gender = "M" if mp_name == "Kristján Pálsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Kristján Pálsson"
replace finished = 1 if mp_name == "Kristján Pálsson"

replace MP_id = 691 if mp_name == "Kristján Þór Júlíusson"
replace gender = "M" if mp_name == "Kristján Þór Júlíusson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Kristján Þór Júlíusson"
replace finished = 1 if mp_name == "Kristján Þór Júlíusson"

replace MP_id = 1015 if mp_name == "Kristrún Heimisdóttir"
replace gender = "F" if mp_name == "Kristrún Heimisdóttir"
replace party = "Samfylkingin" if mp_name == "Kristrún Heimisdóttir"
replace finished = 1 if mp_name == "Kristrún Heimisdóttir"

replace MP_id = 389 if mp_name == "Kristín Einarsdóttir"
replace gender = "F" if mp_name == "Kristín Einarsdóttir"
replace party = "Samtök um kvennalista" if mp_name == "Kristín Einarsdóttir"
replace finished = 1 if mp_name == "Kristín Einarsdóttir"

replace MP_id = 390 if mp_name == "Kristín Halldórsdóttir"
replace gender = "F" if mp_name == "Kristín Halldórsdóttir"
replace party = "Samtök um kvennalista" if mp_name == "Kristín Halldórsdóttir"
replace finished = 1 if mp_name == "Kristín Halldórsdóttir"

replace MP_id = 876 if mp_name == "Kristín Sigurðardóttir"
replace gender = "F" if mp_name == "Kristín Sigurðardóttir"
replace party = "Samtök um kvennalista" if mp_name == "Kristín Sigurðardóttir"
replace finished = 1 if mp_name == "Kristín Sigurðardóttir"

replace MP_id = 388 if mp_name == "Kristín Ástgeirsdóttir"
replace gender = "F" if mp_name == "Kristín Ástgeirsdóttir"
*replace party = "Þingflokkur óháðra" if mp_name == "Kristín Ástgeirsdóttir"
replace finished = 1 if mp_name == "Kristín Ástgeirsdóttir"

replace MP_id = 1244 if mp_name == "Lilja Alfreðsdóttir"
replace gender = "F" if mp_name == "Lilja Alfreðsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Lilja Alfreðsdóttir"
replace finished = 1 if mp_name == "Lilja Alfreðsdóttir"

replace MP_id = 711 if mp_name == "Lilja Mósesdóttir"
replace gender = "F" if mp_name == "Lilja Mósesdóttir"
*replace party = "utan flokka" if mp_name == "Lilja Mósesdóttir"
replace finished = 1 if mp_name == "Lilja Mósesdóttir"

replace MP_id = 714 if mp_name == "Lilja Rafney Magnúsdóttir"
replace gender = "F" if mp_name == "Lilja Rafney Magnúsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Lilja Rafney Magnúsdóttir"
replace finished = 1 if mp_name == "Lilja Rafney Magnúsdóttir"

replace MP_id = 1128 if mp_name == "Logi Einarsson"
replace gender = "M" if mp_name == "Logi Einarsson"
replace party = "Samfylkingin" if mp_name == "Logi Einarsson"
replace finished = 1 if mp_name == "Logi Einarsson"

replace MP_id = 398 if mp_name == "Lára Margrét Ragnarsdóttir"
replace gender = "F" if mp_name == "Lára Margrét Ragnarsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Lára Margrét Ragnarsdóttir"
replace finished = 1 if mp_name == "Lára Margrét Ragnarsdóttir"

replace MP_id = 1170 if mp_name == "Líneik Anna Sævarsdóttir"
replace gender = "F" if mp_name == "Líneik Anna Sævarsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Líneik Anna Sævarsdóttir"
replace finished = 1 if mp_name == "Líneik Anna Sævarsdóttir"

replace MP_id = 407 if mp_name == "Lúðvík Bergvinsson"
replace gender = "M" if mp_name == "Lúðvík Bergvinsson"
replace party = "Samfylkingin" if mp_name == "Lúðvík Bergvinsson" & sessionnum>=124
replace finished = 1 if mp_name == "Lúðvík Bergvinsson"

replace MP_id = 1130 if mp_name == "Lúðvík Geirsson"
replace gender = "M" if mp_name == "Lúðvík Geirsson"
replace party = "Samfylkingin" if mp_name == "Lúðvík Geirsson"
replace finished = 1 if mp_name == "Lúðvík Geirsson"

replace MP_id = 1140 if mp_name == "Magnús M. Norðdahl"
replace gender = "M" if mp_name == "Magnús M. Norðdahl"
replace party = "Samfylkingin" if mp_name == "Magnús M. Norðdahl"
replace finished = 1 if mp_name == "Magnús M. Norðdahl"

replace MP_id = 725 if mp_name == "Magnús Orri Schram"
replace gender = "M" if mp_name == "Magnús Orri Schram"
replace party = "Samfylkingin" if mp_name == "Magnús Orri Schram"
replace finished = 1 if mp_name == "Magnús Orri Schram"

replace MP_id = 425 if mp_name == "Magnús Stefánsson"
replace gender = "M" if mp_name == "Magnús Stefánsson"
replace party = "Framsóknarflokkur" if mp_name == "Magnús Stefánsson"
replace finished = 1 if mp_name == "Magnús Stefánsson"

replace MP_id = 661 if mp_name == "Magnús Þór Hafsteinsson"
replace gender = "M" if mp_name == "Magnús Þór Hafsteinsson"
replace party = "Frjálslyndi flokkurinn" if mp_name == "Magnús Þór Hafsteinsson"
replace finished = 1 if mp_name == "Magnús Þór Hafsteinsson"

replace MP_id = 429 if mp_name == "Margrét Frímannsdóttir"
replace gender = "F" if mp_name == "Margrét Frímannsdóttir"
replace party = "Samfylkingin" if mp_name == "Margrét Frímannsdóttir" & sessionnum>=124
replace finished = 1 if mp_name == "Margrét Frímannsdóttir"

replace MP_id = 723 if mp_name == "Margrét Tryggvadóttir"
replace gender = "F" if mp_name == "Margrét Tryggvadóttir"
*replace party = "Hreyfingin" if mp_name == "Margrét Tryggvadóttir" // Three members of Borgarahreyfingin created Hreyfingin starting 138 (09-10)
replace finished = 1 if mp_name == "Margrét Tryggvadóttir"

replace MP_id = 894 if mp_name == "María E. Ingvadóttir"
replace gender = "F" if mp_name == "María E. Ingvadóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "María E. Ingvadóttir"
replace finished = 1 if mp_name == "María E. Ingvadóttir"

replace MP_id = 430 if mp_name == "Matthías Bjarnason"
replace gender = "M" if mp_name == "Matthías Bjarnason"
replace party = "Sjálfstæðisflokkur" if mp_name == "Matthías Bjarnason"
replace finished = 1 if mp_name == "Matthías Bjarnason"

replace MP_id = 662 if mp_name == "Mörður Árnason"
replace gender = "M" if mp_name == "Mörður Árnason"
replace party = "Samfylkingin" if mp_name == "Mörður Árnason" & sessionnum >= 124
replace finished = 1 if mp_name == "Mörður Árnason"

replace MP_id = 1267 if mp_name == "Nichole Leigh Mosty"
replace gender = "F" if mp_name == "Nichole Leigh Mosty"
replace party = "Björt framtíð" if mp_name == "Nichole Leigh Mosty"
replace finished = 1 if mp_name == "Nichole Leigh Mosty"

replace MP_id = 1255 if mp_name == "Njáll Trausti Friðbertsson"
replace gender = "M" if mp_name == "Njáll Trausti Friðbertsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Njáll Trausti Friðbertsson"
replace finished = 1 if mp_name == "Njáll Trausti Friðbertsson"

replace MP_id = 719 if mp_name == "Oddný G. Harðardóttir"
replace gender = "F" if mp_name == "Oddný G. Harðardóttir"
replace party = "Samfylkingin" if mp_name == "Oddný G. Harðardóttir"
replace finished = 1 if mp_name == "Oddný G. Harðardóttir"

replace MP_id = 1295 if mp_name == "Oktavía Hrund Jónsdóttir"
replace gender = "F" if mp_name == "Oktavía Hrund Jónsdóttir"
replace party = "Píratar" if mp_name == "Oktavía Hrund Jónsdóttir"
replace finished = 1 if mp_name == "Oktavía Hrund Jónsdóttir"

replace MP_id = 1341 if mp_name == "Olga Margrét Cilia"
replace gender = "F" if mp_name == "Olga Margrét Cilia"
replace party = "Píratar" if mp_name == "Olga Margrét Cilia"
replace finished = 1 if mp_name == "Olga Margrét Cilia"

replace MP_id = 1287 if mp_name == "Orri Páll Jóhannsson"
replace gender = "M" if mp_name == "Orri Páll Jóhannsson"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Orri Páll Jóhannsson"
replace finished = 1 if mp_name == "Orri Páll Jóhannsson"

replace MP_id = 1026 if mp_name == "Paul Nikolov"
replace gender = "M" if mp_name == "Paul Nikolov"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Paul Nikolov"
replace finished = 1 if mp_name == "Paul Nikolov"

replace MP_id = 1251 if mp_name == "Pawel Bartoszek"
replace gender = "M" if mp_name == "Pawel Bartoszek"
replace party = "Viðreisn" if mp_name == "Pawel Bartoszek"
replace finished = 1 if mp_name == "Pawel Bartoszek"

replace MP_id = 475 if mp_name == "Petrína Baldursdóttir"
replace gender = "F" if mp_name == "Petrína Baldursdóttir"
replace party = "Alþýðuflokkur" if mp_name == "Petrína Baldursdóttir"
replace finished = 1 if mp_name == "Petrína Baldursdóttir"

replace MP_id = 1173 if mp_name == "Páll Jóhann Pálsson"
replace gender = "M" if mp_name == "Páll Jóhann Pálsson"
replace party = "Framsóknarflokkur" if mp_name == "Páll Jóhann Pálsson"
replace finished = 1 if mp_name == "Páll Jóhann Pálsson"

replace MP_id = 1073 if mp_name == "Páll Magnússon" & sessionnum <= 130
replace gender = "M" if mp_name == "Páll Magnússon" & sessionnum <= 130
replace party = "Framsóknarflokkur" if mp_name == "Páll Magnússon" & sessionnum <= 130
replace finished = 1 if mp_name == "Páll Magnússon" & sessionnum <= 130

replace MP_id = 1266 if mp_name == "Páll Magnússon" & sessionnum >= 146
replace gender = "M" if mp_name == "Páll Magnússon" & sessionnum >= 146
replace party = "Sjálfstæðisflokkur" if mp_name == "Páll Magnússon" & sessionnum >= 146
replace finished = 1 if mp_name == "Páll Magnússon" & sessionnum >= 146

replace MP_id = 467 if mp_name == "Páll Pétursson"
replace gender = "M" if mp_name == "Páll Pétursson"
replace party = "Framsóknarflokkur" if mp_name == "Páll Pétursson"
replace finished = 1 if mp_name == "Páll Pétursson"

replace MP_id = 1172 if mp_name == "Páll Valur Björnsson"
replace gender = "M" if mp_name == "Páll Valur Björnsson"
replace party = "Björt framtíð" if mp_name == "Páll Valur Björnsson"
replace finished = 1 if mp_name == "Páll Valur Björnsson"

replace MP_id = 474 if mp_name == "Pálmi Jónsson"
replace gender = "M" if mp_name == "Pálmi Jónsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Pálmi Jónsson"
replace finished = 1 if mp_name == "Pálmi Jónsson"

replace MP_id = 912 if mp_name == "Pétur Bjarnason"
replace gender = "M" if mp_name == "Pétur Bjarnason"
*replace party = "Frjálslyndi flokkurinn" if mp_name == "Pétur Bjarnason"
replace finished = 1 if mp_name == "Pétur Bjarnason"

replace MP_id = 477 if mp_name == "Pétur H. Blöndal"
replace gender = "M" if mp_name == "Pétur H. Blöndal"
replace party = "Sjálfstæðisflokkur" if mp_name == "Pétur H. Blöndal"
replace finished = 1 if mp_name == "Pétur H. Blöndal"

replace MP_id = 915 if mp_name == "Pétur Sigurðsson"
replace gender = "M" if mp_name == "Pétur Sigurðsson"
replace party = "Alþýðuflokkur" if mp_name == "Pétur Sigurðsson"
replace finished = 1 if mp_name == "Pétur Sigurðsson"

replace MP_id = 732 if mp_name == "Ragna Árnadóttir"
replace gender = "F" if mp_name == "Ragna Árnadóttir"
replace party = "None" if mp_name == "Ragna Árnadóttir"
replace finished = 1 if mp_name == "Ragna Árnadóttir"

replace MP_id = 488 if mp_name == "Ragnar Arnalds"
replace gender = "M" if mp_name == "Ragnar Arnalds"
replace party = "Alþýðubandalagið" if mp_name == "Ragnar Arnalds"
replace finished = 1 if mp_name == "Ragnar Arnalds"

replace MP_id = 918 if mp_name == "Ragnar Elbergsson"
replace gender = "M" if mp_name == "Ragnar Elbergsson"
replace party = "Alþýðubandalagið" if mp_name == "Ragnar Elbergsson"
replace finished = 1 if mp_name == "Ragnar Elbergsson"

replace MP_id = 921 if mp_name == "Ragnar Þorgeirsson"
replace gender = "M" if mp_name == "Ragnar Þorgeirsson"
replace party = "Framsóknarflokkur" if mp_name == "Ragnar Þorgeirsson"
replace finished = 1 if mp_name == "Ragnar Þorgeirsson"

replace MP_id = 693 if mp_name == "Ragnheiður E. Árnadóttir"
replace gender = "F" if mp_name == "Ragnheiður E. Árnadóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Ragnheiður E. Árnadóttir"
replace finished = 1 if mp_name == "Ragnheiður E. Árnadóttir"

replace MP_id = 1074 if mp_name == "Ragnheiður Hákonardóttir"
replace gender = "F" if mp_name == "Ragnheiður Hákonardóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Ragnheiður Hákonardóttir"
replace finished = 1 if mp_name == "Ragnheiður Hákonardóttir"

replace MP_id = 694 if mp_name == "Ragnheiður Ríkharðsdóttir"
replace gender = "F" if mp_name == "Ragnheiður Ríkharðsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Ragnheiður Ríkharðsdóttir"
replace finished = 1 if mp_name == "Ragnheiður Ríkharðsdóttir"

replace MP_id = 491 if mp_name == "Rannveig Guðmundsdóttir"
replace gender = "F" if mp_name == "Rannveig Guðmundsdóttir"
replace party = "Samfylkingin" if mp_name == "Rannveig Guðmundsdóttir" & sessionnum>=124
replace finished = 1 if mp_name == "Rannveig Guðmundsdóttir"

replace MP_id = 708 if mp_name == "Róbert Marshall"
replace gender = "M" if mp_name == "Róbert Marshall"
replace party = "Samfylkingin" if mp_name == "Róbert Marshall" & sessionnum<142
replace party = "Björt framtíð" if mp_name == "Róbert Marshall" & sessionnum>=142
replace finished = 1 if mp_name == "Róbert Marshall"

replace MP_id = 1183 if mp_name == "Rósa Björk Brynjólfsdóttir"
replace gender = "F" if mp_name == "Rósa Björk Brynjólfsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Rósa Björk Brynjólfsdóttir"
replace finished = 1 if mp_name == "Rósa Björk Brynjólfsdóttir"

replace MP_id = 1019 if mp_name == "Rósa Guðbjartsdóttir"
replace gender = "F" if mp_name == "Rósa Guðbjartsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Rósa Guðbjartsdóttir"
replace finished = 1 if mp_name == "Rósa Guðbjartsdóttir"

replace MP_id = 493 if mp_name == "Salome Þorkelsdóttir"
replace gender = "F" if mp_name == "Salome Þorkelsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Salome Þorkelsdóttir"
replace finished = 1 if mp_name == "Salome Þorkelsdóttir"

replace MP_id = 1238 if mp_name == "Sandra Dís Hafþórsdóttir"
replace gender = "F" if mp_name == "Sandra Dís Hafþórsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Sandra Dís Hafþórsdóttir"
replace finished = 1 if mp_name == "Sandra Dís Hafþórsdóttir"

replace MP_id = 1120 if mp_name == "Sandra Franks"
replace gender = "F" if mp_name == "Sandra Franks"
replace party = "Samfylkingin" if mp_name == "Sandra Franks"
replace finished = 1 if mp_name == "Sandra Franks"

replace MP_id = 494 if mp_name == "Sigbjörn Gunnarsson"
replace gender = "M" if mp_name == "Sigbjörn Gunnarsson"
replace party = "Alþýðuflokkur" if mp_name == "Sigbjörn Gunnarsson"
replace finished = 1 if mp_name == "Sigbjörn Gunnarsson"

replace MP_id = 499 if mp_name == "Sighvatur Björgvinsson"
replace gender = "M" if mp_name == "Sighvatur Björgvinsson"
replace party = "Alþýðuflokkur" if mp_name == "Sighvatur Björgvinsson" & sessionnum<=120
replace party = "Samfylkingin" if mp_name == "Sighvatur Björgvinsson" & sessionnum==124
replace finished = 1 if mp_name == "Sighvatur Björgvinsson"

replace MP_id = 729 if mp_name == "Sigmundur Davíð Gunnlaugsson"
replace gender = "M" if mp_name == "Sigmundur Davíð Gunnlaugsson"
replace party = "Framsóknarflokkur" if mp_name == "Sigmundur Davíð Gunnlaugsson" & sessionnum <= 147
replace party = "Miðflokkurinn" if mp_name == "Sigmundur Davíð Gunnlaugsson" & sessionnum >= 148
replace finished = 1 if mp_name == "Sigmundur Davíð Gunnlaugsson"

replace MP_id = 717 if mp_name == "Sigmundur Ernir Rúnarsson"
replace gender = "M" if mp_name == "Sigmundur Ernir Rúnarsson"
replace party = "Samfylkingin" if mp_name == "Sigmundur Ernir Rúnarsson"
replace finished = 1 if mp_name == "Sigmundur Ernir Rúnarsson"

replace MP_id = 501 if mp_name == "Sigríður A. Þórðardóttir"
replace gender = "F" if mp_name == "Sigríður A. Þórðardóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Sigríður A. Þórðardóttir"
replace finished = 1 if mp_name == "Sigríður A. Þórðardóttir"

replace MP_id = 712 if mp_name == "Sigríður Ingibjörg Ingadóttir"
replace gender = "F" if mp_name == "Sigríður Ingibjörg Ingadóttir"
replace party = "Samfylkingin" if mp_name == "Sigríður Ingibjörg Ingadóttir"
replace finished = 1 if mp_name == "Sigríður Ingibjörg Ingadóttir"

replace MP_id = 635 if mp_name == "Sigríður Ingvarsdóttir"
replace gender = "F" if mp_name == "Sigríður Ingvarsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Sigríður Ingvarsdóttir"
replace finished = 1 if mp_name == "Sigríður Ingvarsdóttir"

replace MP_id = 502 if mp_name == "Sigríður Jóhannesdóttir"
replace gender = "F" if mp_name == "Sigríður Jóhannesdóttir"
replace party = "Samfylkingin" if mp_name == "Sigríður Jóhannesdóttir" & sessionnum >= 124
replace finished = 1 if mp_name == "Sigríður Jóhannesdóttir"

replace MP_id = 1350 if mp_name == "Sigríður María Egilsdóttir"
replace gender = "F" if mp_name == "Sigríður María Egilsdóttir"
replace party = "Viðreisn" if mp_name == "Sigríður María Egilsdóttir"
replace finished = 1 if mp_name == "Sigríður María Egilsdóttir"

replace MP_id = 1075 if mp_name == "Sigríður Ragnarsdóttir"
replace gender = "F" if mp_name == "Sigríður Ragnarsdóttir"
replace party = "Samfylkingin" if mp_name == "Sigríður Ragnarsdóttir"
replace finished = 1 if mp_name == "Sigríður Ragnarsdóttir"

replace MP_id = 1018 if mp_name == "Sigríður Á. Andersen"
replace gender = "F" if mp_name == "Sigríður Á. Andersen"
replace party = "Sjálfstæðisflokkur" if mp_name == "Sigríður Á. Andersen"
replace finished = 1 if mp_name == "Sigríður Á. Andersen"

replace MP_id = 1311 if mp_name == "Sigrún Ingibjörg Gísladóttir"
replace gender = "F" if mp_name == "Sigrún Ingibjörg Gísladóttir"
replace party = "Viðreisn" if mp_name == "Sigrún Ingibjörg Gísladóttir"
replace finished = 1 if mp_name == "Sigrún Ingibjörg Gísladóttir"

replace MP_id = 934 if mp_name == "Sigrún Magnúsdóttir"
replace gender = "F" if mp_name == "Sigrún Magnúsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Sigrún Magnúsdóttir"
replace finished = 1 if mp_name == "Sigrún Magnúsdóttir"

replace MP_id = 1243 if mp_name == "Sigurbjörg Erla Egilsdóttir"
replace gender = "F" if mp_name == "Sigurbjörg Erla Egilsdóttir"
replace party = "Píratar" if mp_name == "Sigurbjörg Erla Egilsdóttir"
replace finished = 1 if mp_name == "Sigurbjörg Erla Egilsdóttir"

replace MP_id = 1006 if mp_name == "Sigurgeir Sindri Sigurgeirsson"
replace gender = "M" if mp_name == "Sigurgeir Sindri Sigurgeirsson"
replace party = "Framsóknarflokkur" if mp_name == "Sigurgeir Sindri Sigurgeirsson"
replace finished = 1 if mp_name == "Sigurgeir Sindri Sigurgeirsson"

replace MP_id = 664 if mp_name == "Sigurjón Þórðarson"
replace gender = "M" if mp_name == "Sigurjón Þórðarson"
replace party = "Frjálslyndi flokkurinn" if mp_name == "Sigurjón Þórðarson"
replace finished = 1 if mp_name == "Sigurjón Þórðarson"

replace MP_id = 1041 if mp_name == "Sigurlín Margrét Sigurðardóttir"
replace gender = "F" if mp_name == "Sigurlín Margrét Sigurðardóttir"
*replace party = "utan flokka" if mp_name == "Sigurlín Margrét Sigurðardóttir"
replace finished = 1 if mp_name == "Sigurlín Margrét Sigurðardóttir"

replace MP_id = 671 if mp_name == "Sigurrós Þorgrímsdóttir"
replace gender = "F" if mp_name == "Sigurrós Þorgrímsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Sigurrós Þorgrímsdóttir"
replace finished = 1 if mp_name == "Sigurrós Þorgrímsdóttir"

replace MP_id = 941 if mp_name == "Sigurður Hlöðvesson"
replace gender = "M" if mp_name == "Sigurður Hlöðvesson"
replace party = "Alþýðubandalagið" if mp_name == "Sigurður Hlöðvesson"
replace finished = 1 if mp_name == "Sigurður Hlöðvesson"

replace MP_id = 726 if mp_name == "Sigurður Ingi Jóhannsson"
replace gender = "M" if mp_name == "Sigurður Ingi Jóhannsson"
replace party = "Framsóknarflokkur" if mp_name == "Sigurður Ingi Jóhannsson"
replace finished = 1 if mp_name == "Sigurður Ingi Jóhannsson"

replace MP_id = 663 if mp_name == "Sigurður Kári Kristjánsson"
replace gender = "M" if mp_name == "Sigurður Kári Kristjánsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Sigurður Kári Kristjánsson"
replace finished = 1 if mp_name == "Sigurður Kári Kristjánsson"

replace MP_id = 1203 if mp_name == "Sigurður Páll Jónsson"
replace gender = "M" if mp_name == "Sigurður Páll Jónsson"
replace party = "Miðflokkurinn" if mp_name == "Sigurður Páll Jónsson"
replace finished = 1 if mp_name == "Sigurður Páll Jónsson"

replace MP_id = 1174 if mp_name == "Silja Dögg Gunnarsdóttir"
replace gender = "F" if mp_name == "Silja Dögg Gunnarsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Silja Dögg Gunnarsdóttir"
replace finished = 1 if mp_name == "Silja Dögg Gunnarsdóttir"

replace MP_id = 530 if mp_name == "Siv Friðleifsdóttir"
replace gender = "F" if mp_name == "Siv Friðleifsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Siv Friðleifsdóttir"
replace finished = 1 if mp_name == "Siv Friðleifsdóttir"

replace MP_id = 720 if mp_name == "Skúli Helgason"
replace gender = "M" if mp_name == "Skúli Helgason"
replace party = "Samfylkingin" if mp_name == "Skúli Helgason"
replace finished = 1 if mp_name == "Skúli Helgason"

replace MP_id = 1268 if mp_name == "Smári McCarthy"
replace gender = "M" if mp_name == "Smári McCarthy"
replace party = "Píratar" if mp_name == "Smári McCarthy"
replace finished = 1 if mp_name == "Smári McCarthy"

replace MP_id = 1077 if mp_name == "Soffía Gísladóttir"
replace gender = "F" if mp_name == "Soffía Gísladóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Soffía Gísladóttir"
replace finished = 1 if mp_name == "Soffía Gísladóttir"

replace MP_id = 957 if mp_name == "Stefanía Traustadóttir"
replace gender = "F" if mp_name == "Stefanía Traustadóttir"
replace party = "Alþýðubandalagið" if mp_name == "Stefanía Traustadóttir"
replace finished = 1 if mp_name == "Stefanía Traustadóttir"

replace MP_id = 541 if mp_name == "Stefán Guðmundsson"
replace gender = "M" if mp_name == "Stefán Guðmundsson"
replace party = "Framsóknarflokkur" if mp_name == "Stefán Guðmundsson"
replace finished = 1 if mp_name == "Stefán Guðmundsson"

replace MP_id = 554 if mp_name == "Steingrímur Hermannsson"
replace gender = "M" if mp_name == "Steingrímur Hermannsson"
replace party = "Framsóknarflokkur" if mp_name == "Steingrímur Hermannsson"
replace finished = 1 if mp_name == "Steingrímur Hermannsson"

replace MP_id = 557 if mp_name == "Steingrímur J. Sigfússon"
replace gender = "M" if mp_name == "Steingrímur J. Sigfússon"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Steingrímur J. Sigfússon" & sessionnum >= 124
replace finished = 1 if mp_name == "Steingrímur J. Sigfússon"

replace MP_id = 695 if mp_name == "Steinunn Valdís Óskarsdóttir"
replace gender = "F" if mp_name == "Steinunn Valdís Óskarsdóttir"
replace party = "Samfylkingin" if mp_name == "Steinunn Valdís Óskarsdóttir"
replace finished = 1 if mp_name == "Steinunn Valdís Óskarsdóttir"

replace MP_id = 1031 if mp_name == "Steinunn Þóra Árnadóttir"
replace gender = "F" if mp_name == "Steinunn Þóra Árnadóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Steinunn Þóra Árnadóttir"
replace finished = 1 if mp_name == "Steinunn Þóra Árnadóttir"

replace MP_id = 560 if mp_name == "Sturla Böðvarsson"
replace gender = "M" if mp_name == "Sturla Böðvarsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Sturla Böðvarsson"
replace finished = 1 if mp_name == "Sturla Böðvarsson"

replace MP_id = 1079 if mp_name == "Sturla D. Þorsteinsson"
replace gender = "M" if mp_name == "Sturla D. Þorsteinsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Sturla D. Þorsteinsson"
replace finished = 1 if mp_name == "Sturla D. Þorsteinsson"

replace MP_id = 730 if mp_name == "Svandís Svavarsdóttir"
replace gender = "F" if mp_name == "Svandís Svavarsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Svandís Svavarsdóttir"
replace finished = 1 if mp_name == "Svandís Svavarsdóttir"

replace MP_id = 561 if mp_name == "Svanfríður Jónasdóttir"
replace gender = "F" if mp_name == "Svanfríður Jónasdóttir"
replace party = "Samfylkingin" if mp_name == "Svanfríður Jónasdóttir" & sessionnum == 124
replace finished = 1 if mp_name == "Svanfríður Jónasdóttir"

replace MP_id = 959 if mp_name == "Svanhildur Árnadóttir"
replace gender = "F" if mp_name == "Svanhildur Árnadóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Svanhildur Árnadóttir"
replace finished = 1 if mp_name == "Svanhildur Árnadóttir"

replace MP_id = 563 if mp_name == "Svavar Gestsson"
replace gender = "M" if mp_name == "Svavar Gestsson"
replace party = "Alþýðubandalagið" if mp_name == "Svavar Gestsson"
replace finished = 1 if mp_name == "Svavar Gestsson"

replace MP_id = 573 if mp_name == "Sverrir Hermannsson"
replace gender = "M" if mp_name == "Sverrir Hermannsson"
replace party = "Frjálslyndi flokkurinn" if mp_name == "Sverrir Hermannsson"
replace finished = 1 if mp_name == "Sverrir Hermannsson"

replace MP_id = 967 if mp_name == "Sverrir Sveinsson"
replace gender = "M" if mp_name == "Sverrir Sveinsson"
replace party = "Framsóknarflokkur" if mp_name == "Sverrir Sveinsson"
replace finished = 1 if mp_name == "Sverrir Sveinsson"

replace MP_id = 674 if mp_name == "Sæunn Stefánsdóttir"
replace gender = "F" if mp_name == "Sæunn Stefánsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Sæunn Stefánsdóttir"
replace finished = 1 if mp_name == "Sæunn Stefánsdóttir"

replace MP_id = 538 if mp_name == "Sólveig Pétursdóttir"
replace gender = "F" if mp_name == "Sólveig Pétursdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Sólveig Pétursdóttir"
replace finished = 1 if mp_name == "Sólveig Pétursdóttir"

replace MP_id = 1256 if mp_name == "Teitur Björn Einarsson"
replace gender = "M" if mp_name == "Teitur Björn Einarsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Teitur Björn Einarsson"
replace finished = 1 if mp_name == "Teitur Björn Einarsson"

replace MP_id = 1142 if mp_name == "Telma Magnúsdóttir"
replace gender = "F" if mp_name == "Telma Magnúsdóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Telma Magnúsdóttir"
replace finished = 1 if mp_name == "Telma Magnúsdóttir"

replace MP_id = 1269 if mp_name == "Theodóra S. Þorsteinsdóttir"
replace gender = "F" if mp_name == "Theodóra S. Þorsteinsdóttir"
replace party = "Björt framtíð" if mp_name == "Theodóra S. Þorsteinsdóttir"
replace finished = 1 if mp_name == "Theodóra S. Þorsteinsdóttir"

replace MP_id = 710 if mp_name == "Tryggvi Þór Herbertsson"
replace gender = "M" if mp_name == "Tryggvi Þór Herbertsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Tryggvi Þór Herbertsson"
replace finished = 1 if mp_name == "Tryggvi Þór Herbertsson"

replace MP_id = 579 if mp_name == "Tómas Ingi Olrich"
replace gender = "M" if mp_name == "Tómas Ingi Olrich"
replace party = "Sjálfstæðisflokkur" if mp_name == "Tómas Ingi Olrich"
replace finished = 1 if mp_name == "Tómas Ingi Olrich"

replace MP_id = 1342 if mp_name == "Una Hildardóttir"
replace gender = "F" if mp_name == "Una Hildardóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Una Hildardóttir"
replace finished = 1 if mp_name == "Una Hildardóttir"

replace MP_id = 1121 if mp_name == "Una María Óskarsdóttir"
replace gender = "F" if mp_name == "Una María Óskarsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Una María Óskarsdóttir"
replace finished = 1 if mp_name == "Una María Óskarsdóttir"

replace MP_id = 721 if mp_name == "Unnur Brá Konráðsdóttir"
replace gender = "F" if mp_name == "Unnur Brá Konráðsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Unnur Brá Konráðsdóttir"
replace finished = 1 if mp_name == "Unnur Brá Konráðsdóttir"

replace MP_id = 669 if mp_name == "Valdimar L. Friðriksson"
replace gender = "M" if mp_name == "Valdimar L. Friðriksson"
replace party = "Samfylkingin" if mp_name == "Valdimar L. Friðriksson"
replace finished = 1 if mp_name == "Valdimar L. Friðriksson"

replace MP_id = 705 if mp_name == "Valgerður Bjarnadóttir"
replace gender = "F" if mp_name == "Valgerður Bjarnadóttir"
replace party = "Samfylkingin" if mp_name == "Valgerður Bjarnadóttir"
replace finished = 1 if mp_name == "Valgerður Bjarnadóttir"

replace MP_id = 1175 if mp_name == "Valgerður Gunnarsdóttir"
replace gender = "F" if mp_name == "Valgerður Gunnarsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Valgerður Gunnarsdóttir"
replace finished = 1 if mp_name == "Valgerður Gunnarsdóttir"

replace MP_id = 13 if mp_name == "Valgerður Sverrisdóttir"
replace gender = "F" if mp_name == "Valgerður Sverrisdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Valgerður Sverrisdóttir"
replace finished = 1 if mp_name == "Valgerður Sverrisdóttir"

replace MP_id = 706 if mp_name == "Vigdís Hauksdóttir"
replace gender = "F" if mp_name == "Vigdís Hauksdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Vigdís Hauksdóttir"
replace finished = 1 if mp_name == "Vigdís Hauksdóttir"

replace MP_id = 1137 if mp_name == "Viktor B. Kjartansson"
replace gender = "M" if mp_name == "Viktor B. Kjartansson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Viktor B. Kjartansson"
replace finished = 1 if mp_name == "Viktor B. Kjartansson"

replace MP_id = 1286 if mp_name == "Viktor Orri Valgarðsson"
replace gender = "M" if mp_name == "Viktor Orri Valgarðsson"
replace party = "Píratar" if mp_name == "Viktor Orri Valgarðsson"
replace finished = 1 if mp_name == "Viktor Orri Valgarðsson"

replace MP_id = 1177 if mp_name == "Vilhjálmur Bjarnason"
replace gender = "M" if mp_name == "Vilhjálmur Bjarnason"
replace party = "Sjálfstæðisflokkur" if mp_name == "Vilhjálmur Bjarnason"
replace finished = 1 if mp_name == "Vilhjálmur Bjarnason"

replace MP_id = 586 if mp_name == "Vilhjálmur Egilsson"
replace gender = "M" if mp_name == "Vilhjálmur Egilsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Vilhjálmur Egilsson"
replace finished = 1 if mp_name == "Vilhjálmur Egilsson"

replace MP_id = 1176 if mp_name == "Vilhjálmur Árnason"
replace gender = "M" if mp_name == "Vilhjálmur Árnason"
replace party = "Sjálfstæðisflokkur" if mp_name == "Vilhjálmur Árnason"
replace finished = 1 if mp_name == "Vilhjálmur Árnason"

replace MP_id = 1081 if mp_name == "Vilhjálmur Þ. Vilhjálmsson"
replace gender = "M" if mp_name == "Vilhjálmur Þ. Vilhjálmsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Vilhjálmur Þ. Vilhjálmsson"
replace finished = 1 if mp_name == "Vilhjálmur Þ. Vilhjálmsson"

replace MP_id = 1178 if mp_name == "Willum Þór Þórsson"
replace gender = "M" if mp_name == "Willum Þór Þórsson"
replace party = "Framsóknarflokkur" if mp_name == "Willum Þór Þórsson"
replace finished = 1 if mp_name == "Willum Þór Þórsson"

replace MP_id = 28 if mp_name == "Ágúst Einarsson"
replace gender = "M" if mp_name == "Ágúst Einarsson"
*replace party = "þingflokkur jafnaðarmanna" if mp_name == "Ágúst Einarsson"
replace finished = 1 if mp_name == "Ágúst Einarsson"

replace MP_id = 647 if mp_name == "Ágúst Ólafur Ágústsson"
replace gender = "M" if mp_name == "Ágúst Ólafur Ágústsson"
replace party = "Samfylkingin" if mp_name == "Ágúst Ólafur Ágústsson"
replace finished = 1 if mp_name == "Ágúst Ólafur Ágústsson"

replace MP_id = 750 if mp_name == "Ágústa Gísladóttir"
replace gender = "F" if mp_name == "Ágústa Gísladóttir"
replace party = "Samtök um kvennalista" if mp_name == "Ágústa Gísladóttir"
replace finished = 1 if mp_name == "Ágústa Gísladóttir"

replace MP_id = 1351 if mp_name == "Álfheiður Eymarsdóttir"
replace gender = "F" if mp_name == "Álfheiður Eymarsdóttir"
replace party = "Píratar" if mp_name == "Álfheiður Eymarsdóttir"
replace finished = 1 if mp_name == "Álfheiður Eymarsdóttir"

replace MP_id = 676 if mp_name == "Álfheiður Ingadóttir"
replace gender = "F" if mp_name == "Álfheiður Ingadóttir"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Álfheiður Ingadóttir"
replace finished = 1 if mp_name == "Álfheiður Ingadóttir"

replace MP_id = 677 if mp_name == "Ármann Kr. Ólafsson"
replace gender = "M" if mp_name == "Ármann Kr. Ólafsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Ármann Kr. Ólafsson"
replace finished = 1 if mp_name == "Ármann Kr. Ólafsson"

replace MP_id = 1055 if mp_name == "Árni Gunnarsson"
replace gender = "M" if mp_name == "Árni Gunnarsson"
replace party = "Framsóknarflokkur" if mp_name == "Árni Gunnarsson"
replace finished = 1 if mp_name == "Árni Gunnarsson"

replace MP_id = 38 if mp_name == "Árni Johnsen"
replace gender = "M" if mp_name == "Árni Johnsen"
replace party = "Sjálfstæðisflokkur" if mp_name == "Árni Johnsen"
replace finished = 1 if mp_name == "Árni Johnsen"

replace MP_id = 5 if mp_name == "Árni M. Mathiesen"
replace gender = "M" if mp_name == "Árni M. Mathiesen"
replace party = "Sjálfstæðisflokkur" if mp_name == "Árni M. Mathiesen"
replace finished = 1 if mp_name == "Árni M. Mathiesen"

replace MP_id = 649 if mp_name == "Árni Magnússon"
replace gender = "M" if mp_name == "Árni Magnússon"
replace party = "Framsóknarflokkur" if mp_name == "Árni Magnússon"
replace finished = 1 if mp_name == "Árni Magnússon"

replace MP_id = 678 if mp_name == "Árni Páll Árnason"
replace gender = "M" if mp_name == "Árni Páll Árnason"
replace party = "Samfylkingin" if mp_name == "Árni Páll Árnason"
replace finished = 1 if mp_name == "Árni Páll Árnason"

replace MP_id = 33 if mp_name == "Árni R. Árnason"
replace gender = "M" if mp_name == "Árni R. Árnason"
replace party = "Sjálfstæðisflokkur" if mp_name == "Árni R. Árnason"
replace finished = 1 if mp_name == "Árni R. Árnason"

replace MP_id = 4 if mp_name == "Árni Steinar Jóhannsson"
replace gender = "M" if mp_name == "Árni Steinar Jóhannsson"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Árni Steinar Jóhannsson"
replace finished = 1 if mp_name == "Árni Steinar Jóhannsson"

replace MP_id = 679 if mp_name == "Árni Þór Sigurðsson"
replace gender = "M" if mp_name == "Árni Þór Sigurðsson"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Árni Þór Sigurðsson"
replace finished = 1 if mp_name == "Árni Þór Sigurðsson"

replace MP_id = 718 if mp_name == "Ásbjörn Óttarsson"
replace gender = "M" if mp_name == "Ásbjörn Óttarsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Ásbjörn Óttarsson"
replace finished = 1 if mp_name == "Ásbjörn Óttarsson"

replace MP_id = 1106 if mp_name == "Ásgeir Friðgeirsson"
replace gender = "M" if mp_name == "Ásgeir Friðgeirsson"
replace party = "Samfylkingin" if mp_name == "Ásgeir Friðgeirsson"
replace finished = 1 if mp_name == "Ásgeir Friðgeirsson"

replace MP_id = 1358 if mp_name == "Ásgerður K. Gylfadóttir"
replace gender = "F" if mp_name == "Ásgerður K. Gylfadóttir"
replace party = "Framsóknarflokkur" if mp_name == "Ásgerður K. Gylfadóttir"
replace finished = 1 if mp_name == "Ásgerður K. Gylfadóttir"

replace MP_id = 1261 if mp_name == "Áslaug Arna Sigurbjörnsdóttir"
replace gender = "F" if mp_name == "Áslaug Arna Sigurbjörnsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Áslaug Arna Sigurbjörnsdóttir"
replace finished = 1 if mp_name == "Áslaug Arna Sigurbjörnsdóttir"

replace MP_id = 707 if mp_name == "Ásmundur Einar Daðason"
replace gender = "M" if mp_name == "Ásmundur Einar Daðason"
replace party = "Framsóknarflokkur" if mp_name == "Ásmundur Einar Daðason" & sessionnum == 142
replace finished = 1 if mp_name == "Ásmundur Einar Daðason"

replace MP_id = 1157 if mp_name == "Ásmundur Friðriksson"
replace gender = "M" if mp_name == "Ásmundur Friðriksson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Ásmundur Friðriksson"
replace finished = 1 if mp_name == "Ásmundur Friðriksson"

replace MP_id = 666 if mp_name == "Ásta B. Þorsteinsdóttir"
replace gender = "F" if mp_name == "Ásta B. Þorsteinsdóttir"
replace party = "þingflokkur jafnaðarmanna" if mp_name == "Ásta B. Þorsteinsdóttir"
replace finished = 1 if mp_name == "Ásta B. Þorsteinsdóttir"

replace MP_id = 1214 if mp_name == "Ásta Guðrún Helgadóttir"
replace gender = "F" if mp_name == "Ásta Guðrún Helgadóttir"
replace party = "Píratar" if mp_name == "Ásta Guðrún Helgadóttir"
replace finished = 1 if mp_name == "Ásta Guðrún Helgadóttir"

replace MP_id = 221 if mp_name == "Ásta Möller"
replace gender = "F" if mp_name == "Ásta Möller"
replace party = "Sjálfstæðisflokkur" if mp_name == "Ásta Möller"
replace finished = 1 if mp_name == "Ásta Möller"

replace MP_id = 48 if mp_name == "Ásta R. Jóhannesdóttir"
replace gender = "F" if mp_name == "Ásta R. Jóhannesdóttir"
replace party = "Samfylkingin" if mp_name == "Ásta R. Jóhannesdóttir" & sessionnum >= 124
replace finished = 1 if mp_name == "Ásta R. Jóhannesdóttir"

replace MP_id = 1132 if mp_name == "Íris Róbertsdóttir"
replace gender = "F" if mp_name == "Íris Róbertsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Íris Róbertsdóttir"
replace finished = 1 if mp_name == "Íris Róbertsdóttir"

replace MP_id = 274 if mp_name == "Ísólfur Gylfi Pálmason"
replace gender = "M" if mp_name == "Ísólfur Gylfi Pálmason"
replace party = "Framsóknarflokkur" if mp_name == "Ísólfur Gylfi Pálmason"
replace finished = 1 if mp_name == "Ísólfur Gylfi Pálmason"

replace MP_id = 439 if mp_name == "Ólafur G. Einarsson"
replace gender = "M" if mp_name == "Ólafur G. Einarsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Ólafur G. Einarsson"
replace finished = 1 if mp_name == "Ólafur G. Einarsson"

replace MP_id = 904 if mp_name == "Ólafur Hannibalsson"
replace gender = "M" if mp_name == "Ólafur Hannibalsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Ólafur Hannibalsson"
replace finished = 1 if mp_name == "Ólafur Hannibalsson"

replace MP_id = 440 if mp_name == "Ólafur Ragnar Grímsson"
replace gender = "M" if mp_name == "Ólafur Ragnar Grímsson"
replace party = "Alþýðubandalagið" if mp_name == "Ólafur Ragnar Grímsson"
replace finished = 1 if mp_name == "Ólafur Ragnar Grímsson"

replace MP_id = 1334 if mp_name == "Ólafur Ísleifsson"
replace gender = "M" if mp_name == "Ólafur Ísleifsson"
replace party = "Flokkur fólksins" if mp_name == "Ólafur Ísleifsson"
replace finished = 1 if mp_name == "Ólafur Ísleifsson"

replace MP_id = 441 if mp_name == "Ólafur Örn Haraldsson"
replace gender = "M" if mp_name == "Ólafur Örn Haraldsson"
replace party = "Framsóknarflokkur" if mp_name == "Ólafur Örn Haraldsson"
replace finished = 1 if mp_name == "Ólafur Örn Haraldsson"

replace MP_id = 453 if mp_name == "Ólafur Þ. Þórðarson"
replace gender = "M" if mp_name == "Ólafur Þ. Þórðarson"
replace party = "Framsóknarflokkur" if mp_name == "Ólafur Þ. Þórðarson"
replace finished = 1 if mp_name == "Ólafur Þ. Þórðarson"

replace MP_id = 1001 if mp_name == "Ólafur Þór Gunnarsson"
replace gender = "M" if mp_name == "Ólafur Þór Gunnarsson"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Ólafur Þór Gunnarsson"
replace finished = 1 if mp_name == "Ólafur Þór Gunnarsson"

replace MP_id = 1070 if mp_name == "Ólafía Ingólfsdóttir"
replace gender = "F" if mp_name == "Ólafía Ingólfsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Ólafía Ingólfsdóttir"
replace finished = 1 if mp_name == "Ólafía Ingólfsdóttir"

replace MP_id = 999 if mp_name == "Óli Björn Kárason"
replace gender = "M" if mp_name == "Óli Björn Kárason"
replace party = "Sjálfstæðisflokkur" if mp_name == "Óli Björn Kárason"
replace finished = 1 if mp_name == "Óli Björn Kárason"

replace MP_id = 715 if mp_name == "Ólína Kjerúlf Þorvarðardóttir"
replace gender = "F" if mp_name == "Ólína Kjerúlf Þorvarðardóttir"
replace party = "Samfylkingin" if mp_name == "Ólína Kjerúlf Þorvarðardóttir"
replace finished = 1 if mp_name == "Ólína Kjerúlf Þorvarðardóttir"

replace MP_id = 692 if mp_name == "Ólöf Nordal"
replace gender = "F" if mp_name == "Ólöf Nordal"
replace party = "Sjálfstæðisflokkur" if mp_name == "Ólöf Nordal" & sessionnum == 134
replace finished = 1 if mp_name == "Ólöf Nordal"

replace MP_id = 1171 if mp_name == "Óttarr Proppé"
replace gender = "M" if mp_name == "Óttarr Proppé"
replace party = "Björt framtíð" if mp_name == "Óttarr Proppé"
replace finished = 1 if mp_name == "Óttarr Proppé"

replace MP_id = 630 if mp_name == "Ögmundur Jónasson"
replace gender = "M" if mp_name == "Ögmundur Jónasson"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Ögmundur Jónasson" & sessionnum>=124
replace finished = 1 if mp_name == "Ögmundur Jónasson"

replace MP_id = 1084 if mp_name == "Örlygur Hnefill Jónsson"
replace gender = "M" if mp_name == "Örlygur Hnefill Jónsson"
replace party = "Samfylkingin" if mp_name == "Örlygur Hnefill Jónsson"
replace finished = 1 if mp_name == "Örlygur Hnefill Jónsson"

replace MP_id = 631 if mp_name == "Össur Skarphéðinsson"
replace gender = "M" if mp_name == "Össur Skarphéðinsson"
replace party = "Alþýðuflokkur" if mp_name == "Össur Skarphéðinsson" & sessionnum<=120
replace party = "Samfylkingin" if mp_name == "Össur Skarphéðinsson" & sessionnum==129
replace finished = 1 if mp_name == "Össur Skarphéðinsson"

replace MP_id = 632 if mp_name == "Þorgerður K. Gunnarsdóttir"
replace gender = "F" if mp_name == "Þorgerður K. Gunnarsdóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Þorgerður K. Gunnarsdóttir" & sessionnum<=141
replace party = "Viðreisn" if mp_name == "Þorgerður K. Gunnarsdóttir" & sessionnum>=146
replace finished = 1 if mp_name == "Þorgerður K. Gunnarsdóttir"

replace MP_id = 606 if mp_name == "Þorsteinn Pálsson"
replace gender = "M" if mp_name == "Þorsteinn Pálsson"
replace party = "Sjálfstæðisflokkur" if mp_name == "Þorsteinn Pálsson"
replace finished = 1 if mp_name == "Þorsteinn Pálsson"

replace MP_id = 1179 if mp_name == "Þorsteinn Sæmundsson"
replace gender = "M" if mp_name == "Þorsteinn Sæmundsson"
replace party = "Framsóknarflokkur" if mp_name == "Þorsteinn Sæmundsson" & sessionnum<=145
replace party = "Miðflokkurinn" if mp_name == "Þorsteinn Sæmundsson" & sessionnum>=148
replace finished = 1 if mp_name == "Þorsteinn Sæmundsson"

replace MP_id = 1254 if mp_name == "Þorsteinn Víglundsson"
replace gender = "M" if mp_name == "Þorsteinn Víglundsson"
replace party = "Viðreisn" if mp_name == "Þorsteinn Víglundsson"
replace finished = 1 if mp_name == "Þorsteinn Víglundsson"

replace MP_id = 709 if mp_name == "Þráinn Bertelsson"
replace gender = "M" if mp_name == "Þráinn Bertelsson"
*replace party = "utan flokka" if mp_name == "Þráinn Bertelsson"
replace finished = 1 if mp_name == "Þráinn Bertelsson"

replace MP_id = 634 if mp_name == "Þuríður Backman"
replace gender = "F" if mp_name == "Þuríður Backman"
replace party = "Vinstri hreyfingin – grænt framboð" if mp_name == "Þuríður Backman" & sessionnum>=124
replace finished = 1 if mp_name == "Þuríður Backman"

replace MP_id = 713 if mp_name == "Þór Saari"
replace gender = "M" if mp_name == "Þór Saari"
*replace party = "Hreyfingin" if mp_name == "Þór Saari"
replace finished = 1 if mp_name == "Þór Saari"

replace MP_id = 1050 if mp_name == "Þórarinn E. Sveinsson"
replace gender = "M" if mp_name == "Þórarinn E. Sveinsson"
replace party = "Framsóknarflokkur" if mp_name == "Þórarinn E. Sveinsson"
replace finished = 1 if mp_name == "Þórarinn E. Sveinsson"

replace MP_id = 1252 if mp_name == "Þórdís Kolbrún R. Gylfadóttir"
replace gender = "F" if mp_name == "Þórdís Kolbrún R. Gylfadóttir"
replace party = "Sjálfstæðisflokkur" if mp_name == "Þórdís Kolbrún R. Gylfadóttir"
replace finished = 1 if mp_name == "Þórdís Kolbrún R. Gylfadóttir"

replace MP_id = 1270 if mp_name == "Þórhildur Sunna Ævarsdóttir"
replace gender = "F" if mp_name == "Þórhildur Sunna Ævarsdóttir"
replace party = "Píratar" if mp_name == "Þórhildur Sunna Ævarsdóttir"
replace finished = 1 if mp_name == "Þórhildur Sunna Ævarsdóttir"

replace MP_id = 628 if mp_name == "Þórhildur Þorleifsdóttir"
replace gender = "F" if mp_name == "Þórhildur Þorleifsdóttir"
replace party = "Samtök um kvennalista" if mp_name == "Þórhildur Þorleifsdóttir"
replace finished = 1 if mp_name == "Þórhildur Þorleifsdóttir"

replace MP_id = 1180 if mp_name == "Þórunn Egilsdóttir"
replace gender = "F" if mp_name == "Þórunn Egilsdóttir"
replace party = "Framsóknarflokkur" if mp_name == "Þórunn Egilsdóttir"
replace finished = 1 if mp_name == "Þórunn Egilsdóttir"

replace MP_id = 1095 if mp_name == "Þórunn H. Sveinbjörnsdóttir"
replace gender = "F" if mp_name == "Þórunn H. Sveinbjörnsdóttir"
replace party = "þingflokkur jafnaðarmanna" if mp_name == "Þórunn H. Sveinbjörnsdóttir"
replace finished = 1 if mp_name == "Þórunn H. Sveinbjörnsdóttir"

replace MP_id = 633 if mp_name == "Þórunn Sveinbjarnardóttir"
replace gender = "F" if mp_name == "Þórunn Sveinbjarnardóttir"
replace party = "Samfylkingin" if mp_name == "Þórunn Sveinbjarnardóttir" & sessionnum>=124
replace finished = 1 if mp_name == "Þórunn Sveinbjarnardóttir"

// diagnose problems
duplicates report sessionnum MP_id
count if mi(MP_id)
count if mi(mp_name)
count if mi(gender)
count if mi(party)
tab party

// party -> party_id
gen party_id = .
forv k = 1/20 {
	local full: word `k' of "Alþýðuflokkur" "Alþýðubandalagið" "Framsóknarflokkur" "Sjálfstæðisflokkur" "Samtök um kvennalista" "utan flokka" "Þjóðvaki - hreyfing fólksins" "þingflokkur jafnaðarmanna" "Samfylkingin" "Þingflokkur óháðra" "Frjálslyndi flokkurinn" "Vinstri hreyfingin – grænt framboð" "Borgarahreyfingin" "Hreyfingin" "Björt framtíð" "Viðreisn" "Flokkur fólksins" "Miðflokkurinn" "Píratar" "None"
	// "utan flokka" means an MP with no party affiliation because he or she quit the party but stayed in parliament
	// "None" means a non-MP minister without party affiliation
	replace party_id = `k' if party == "`full'"
}
assert !mi(party_id)

// keep relevant obs and vars
keep if sessionnum >= 115
ren sessionnum session_id
ren mp_name MP_name
drop party_guess finished

// sort
sort MP_id session_id

save "`MPintfolder'/MP_Bio.dta", replace
